Dear All,
I am working on xamarin mobile MVVM application. I have a drop down list and based on selection i want to generate no of checkbox. If any body has done then please help me.
Regards,
Hiren Patel
Dear All,
I am working on xamarin mobile MVVM application. I have a drop down list and based on selection i want to generate no of checkbox. If any body has done then please help me.
Regards,
Hiren Patel
Hi Xamarin dev's
My IOS version app works successfully on Simulator but it is crash and doesn't lunch on physical device without errors.
This is the application output
dyld: Library not loaded: @rpath/GoogleToolboxForMac.framework/GoogleToolboxForMac
Referenced from: /private/var/containers/Bundle/Application/0C69CF2C-BD07-4F3B-A78D-89DFD2D88D4D/Shaabiat.iOS.app/Shaabiat.iOS
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/0C69CF2C-BD07-4F3B-A78D-89DFD2D88D4D/Shaabiat.iOS.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac: code signature invalid for '/private/var/containers/Bundle/Application/0C69CF2C-BD07-4F3B-A78D-89DFD2D88D4D/Shaabiat.iOS.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac'
/private/var/containers/Bundle/Application/0C69CF2C-BD07-4F3B-A78D-89DFD2D88D4D/Shaabiat.iOS.app/Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac: stat() failed with errno=1
and the packages
Please need your help
Hello,
I am creating an app for ios and android with help of xamarin.forms. When I am connecting my iphone device with my mac system for debugging the code it is not showing in the debug list. There is still showing Ios device. But if I open any other project of xamarin.forms Iphone option is showing in the debug list. I don't know why it is not showing only in one project. Is there any setting to enable the iphone device for project? Or any other way to manage iphone device with project?
I am trying to access Google Drive from an XF.UWP app. The Client ID for UWP form on Google API Console is asking to fill in the 'last part of your app's Microsoft Store URL'. What to fill in here, any idea?
I have filled 'com.mycompany.myappname' here and Protocol URL in Package.appxmanifest file. I am setting redirect_uri also to the same thing with a suffix of ':/oauth2redirect'.
In the declaration of Protocol URL, I am setting the StartPage to MainPage.xaml after checking the ExecutableOrStartPageIsRequired box.
My app crashes after 'Allow' is pressed while authenticating.
Any clue what to do?
I am trying to setup push notifications on a Xamarin.Forms Android app following this tutorial and this sample. My AndroidManifest.xml, FirebaseService.cs and MainActivity.cs are basically the same as the sample. When I fire up the Android Emulator and do a Test Send from Azure Notification Hubs I get: "Message was successfully sent, but there were no matching targets." Is that tutorial outdated?
I am not able to build my Android project. It is throwing me the error, as shown in attached.
Following is error details:
Failed to create JavaTypeInfo for class: Android.Support.V4.View.Accessibility.AccessibilityManagerCompat/IAccessibilityStateChangeListenerImplementor due to System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\simeh\source\XamarinApps\CheckListManifesto\CheckListManifesto\CheckListManifesto\CheckListManifesto.Android\obj\Debug\81\android\src\mono\android\support\v4\view\accessibility\AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.java'.
Any help or suggestions on how to fix this?.
Thanks In Advance!!!..
Once I initialized two lists (a, b), I'd like to add one item from list "a" into "b" whenever I press a button. Note, JUST 1 and not the whole list. With my current code, my list "b" keeps being null.
This is what I've tried
//Initialize / declare lists
public List a;
List<string> b= new List<string>();
// List a
a = new List()
{
new Question() { QuestionText="", Answer=false } ,
new Question() { QuestionText="", Answer=false },
new Question() { QuestionText="", Answer=true },
new Question() { QuestionText="", Answer=false },
new Question() { QuestionText="" , Answer=true },
new Question() { QuestionText="", Answer=false },
new Question() { QuestionText="", Answer=false },
};
//Add method---this is what I tried for adding items
if (_currentAnswerValue == false)
score++;
else { b.Add(QuestionText.ToString());
I made an apk, and is working fine on a friend phone
I accidentally create duplicated thread.
How can I delete a thread?
I am getting this error when building for iOS Release with Linker set to all or sdk framework.error MT2091: Inliner failed processing
System.Void MacAttribute::.ctor(System.Byte,System.Byte)``
What does that mean? I cannot find much on that error.
After updating to 4.6 my labels don't work properly in iOS.
If I have a label with Style="{StaticResource Blue1_Font16_Book}" and Text="{helpers:StringResource lblTimeCardSummaryGuideHint}" the style is not applied. It also does not work if the text is hardcoded. (StringResource is a markup extension that returns the value for the key passed to it.)
However, if the label is changed as follows: Style="{StaticResource Blue1_Font16_Book}" Text="{Binding lblTimeCardSummaryGuideHint}" />" the style is applied.
Hi guys, I've got an app with a certain 'splashscreen' style and I wanted to add something to my style.xml file, but when I try to test the app, I get the error: Error APT2260: resource style/splashscreen not found. Any help?
<style name="splashscreen" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowBackground">@drawable/splashscreen960x1440</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsTranslucent">false</item> <item name="android:windowIsFloating">false</item> <item name="android:backgroundDimEnabled">true</item> </style>
Hello evreryone
Just a quick question
I have my view
<ContentPage.BindingContext> <vm:RegisterViewModel /> </ContentPage.BindingContext> <ScrollView> <StackLayout Spacing="20"> <Image Style="{StaticResource ImageStyle}" Margin="0,20,0,0" /> <ActivityIndicator IsRunning="{Binding IsBusy}" Color="#28A586" /> <Grid Margin="10,0,20,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="auto" /> <RowDefinition Height="auto" /> <RowDefinition Height="auto" /> </Grid.RowDefinitions> <Image Source="Usuario.png" /> <Entry Placeholder="Useario" Text="{Binding Username}" Grid.Column="1" Style="{StaticResource Key=EntryStyle}" /> <Image Source="Clave.png" Grid.Row="1" /> <Label Text="Debe tener al menos 8 caracteres y un carácter especial" Grid.Column="1" TextColor="White" Margin="0,-7,0,0" Grid.Row="2" FontSize="11" /> <Entry Placeholder="Contraseña" Text="{Binding Password}" IsPassword="True" Grid.Column="1" Grid.Row="1" Style="{StaticResource EntryStyle}" /> <Image Source="Clave.png" Grid.Row="3" /> <Entry Placeholder="Confirmar contraseña" Text="{Binding ConfrimPassword}" Style="{StaticResource EntryStyle}" IsPassword="True" Grid.Column="1" Grid.Row="3" /> <Image Source="Email.png" Grid.Row="4" /> <Entry Placeholder="Correo Electrónico" Keyboard="Email" Text="{Binding Email}" Style="{StaticResource EntryStyle}" Grid.Column="1" Grid.Row="4" /> </Grid> <Button Text="Registrame" Command="{Binding RegisterCommand}" Style="{StaticResource Key=YellowButtons}" IsEnabled="{Binding IsEnable}" Margin="0,20,0,0" /> <Grid Margin="10,10,10,10"> <Grid.ColumnDefinitions> <ColumnDefinition Width="80" /> </Grid.ColumnDefinitions> <StackLayout Orientation="Horizontal"> <Button Text="Registro con facebook" FontSize="8" TextColor="White" Command="{Binding FacebookCommand}" ContentLayout="Left,20" Image="Facebook.png" HorizontalOptions="Start" BackgroundColor="Transparent" /> </StackLayout> <StackLayout Grid.Column="2" Orientation="Horizontal"> <Button Text="Registro con Gmail" FontSize="8" Command="{Binding GmailCommand}" ContentLayout="Left,20" Image="Gmail.png" TextColor="White" BackgroundColor="Transparent" HorizontalOptions="Start" /> </StackLayout> </Grid> </StackLayout> </ScrollView>
and my view model
class RegisterViewModel : BaseViewModel { public ICommand RegisterCommand { get; set; } public ICommand FacebookCommand { get; set; } public ICommand GmailCommand { get; set; } public RegisterViewModel() { IsEnable = false; FacebookCommand = new Command(() => { Application.Current.MainPage.DisplayAlert("", "Calling facebook", "OK"); }); GmailCommand = new Command(() => { Application.Current.MainPage.DisplayAlert("", "Calling Gmail", "OK"); }); RegisterCommand = new Command(async () => { IsBusy = true; JObject data = new JObject { { "username", Username.ToLower() }, { "password", Password.ToLower() }, { "email", Email.ToLower() } }; var obj = await NetworkHelpper.SendData(Constants.REGISTER, data); string result = obj.Content.ReadAsStringAsync().Result; if (obj.IsSuccessStatusCode) { IsBusy = false; // Application.Current.MainPage.Navigation.PushAsync(new LoginScreen(), true); } else { IsBusy = false; await Application.Current.MainPage.DisplayAlert("Error", result, "ok"); } }); } private string _Username; public string Username { get { return _Username; } set { _Username = value; RaisePropertyChanged(); if (Validator()) { IsEnable = false; } else { IsEnable = true; } } } private string _ConfrimPassword; public string ConfrimPassword { get { return _ConfrimPassword; } set { if (_ConfrimPassword != value) { _ConfrimPassword = value; RaisePropertyChanged(); if (Validator()) { IsEnable = false; } else { IsEnable = true; } } } } private string _Password; public string Password { get { return _Password; } set { if (_Password != value) { _Password = value; RaisePropertyChanged(); if (Validator()) { IsEnable = false; } else { IsEnable = true; } } } } private string _Email; public string Email { get { return _Email; } set { if (_Email != value) { _Email = value; RaisePropertyChanged(); if (Validator()) { IsEnable = false; } else { IsEnable = true; } } } } private bool Validator() { return string.IsNullOrEmpty(_Username) || string.IsNullOrEmpty(_Password) || string.IsNullOrEmpty(_ConfrimPassword) || string.IsNullOrEmpty(_Email) || _ConfrimPassword != _Password; } private bool _IsEnable; public bool IsEnable { get { return _IsEnable; } set { if (_IsEnable != value) { _IsEnable = value; RaisePropertyChanged(); } } } private bool _IsBusy; public bool IsBusy { get { return _IsBusy; } set { if (_IsBusy != value) { _IsBusy = value; RaisePropertyChanged(); } } } } }
For some weird reason the button is not getting disable or enable or anything, but the buttons that the commands are bind to facebook command and gmail command are working perfectly. Any thought?
Hello everyone ,I'm developing an application using Xamarin forms with Zxing library for scanning ,i am calling the scan method in OnApearing method and it scan continously ,i tried everything to conrol but fail
here's my code
` protected override void OnAppearing()
{
base.OnAppearing();
var opt = new MobileBarcodeScanningOptions(); // opt.DelayBetweenContinuousScans = 3000; opt.UseNativeScanning = true; opt.DisableAutofocus = true; zXingView.Options = opt; TimeSpan ts = new TimeSpan(0, 0, 0, 2, 0); Device.StartTimer(ts, () => { if (zXingView.IsScanning) zXingView.AutoFocus(); return true; }); zXingView.OnScanResult += (result) => { if (result == null) { Application.Current.MainPage.DisplayAlert("Failed", "No barcode found,please try again", "Okay"); return; } Device.BeginInvokeOnMainThread(async () => { await Application.Current.MainPage.DisplayAlert(result.Text.ToString(), "", "OK"); }); UserDialogs.Instance.HideLoading(); }; }
`
i also tried isScanning property to true but it scan only once
Select some texts and copy it
I am using the xamarin essentials
package for text to speech feature. When speech the text I need to highlight the corresponding text. Also, I need an option to pause/play the speech. Please see this video.
Screenshot:
How can I achieve highlight text feature and pause/play audio as the video?
Hi Team,
Getting this exception in the case of android when I am trying to connect https connection.
{System.Net.Sockets.SocketException (0x80004005): No such host is known
at System.Net.Http.ConnectHelper.ConnectAsync (System.String host, System.Int32 port, System.Threading.CancellationToken cancellationToken) [0x000c8] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corefx/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectHelper.cs:65 }
please help me, it would be great for me!
Hi everyone, I'm getting a headache to display some dashboards into my Xamarin Forms project, as you can see in the picture below it's working pretty nice at Android devices. However when it goes to IOS it doesn't work, the screen does not fill and expand and the view is not properly exhibiting in "Mobile Mode View",
I'm using a Tableau Desktop to make these dashboards and then I insert a EMBED into my HTML pages to then display it on my Xamarin, here's what I used to manage it to work, i followed Microsoft documentation to display the HTML content into a webview
And here is the Javascript embed API to display the dashboard:
<div class='tableauPlaceholder' id='viz1587599706721' style='position: relative'> <noscript> <a href='#'> <img alt=' ' src='https://public.tableau.com/static/images/Da/DashboardEFColunasSample/DashboardMainTest/1_rss.png' style='border: none' /> </a> </noscript> <object class='tableauViz' style='display:none;'> <param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /> <param name='name' value='DashboardEFColunasSample/DashboardMainTest' /> <param name='tabs' value='no' /> <param name='toolbar' value='yes' /> <param name='static_image' value='https://public.tableau.com/static/images/Da/DashboardEFColunasSample/DashboardMainTest/1.png' /> <param name='animate_transition' value='yes' /> <param name='display_static_image' value='yes' /> <param name='display_spinner' value='yes' /> <param name='display_overlay' value='yes' /> <param name='display_count' value='yes' /> <param name='filter' value='publish=yes' /> </object> </div> <script type='text/javascript'> var divElement = document.getElementById('viz1587599706721'); var vizElement = divElement.getElementsByTagName('object')[0]; if (divElement.offsetWidth > 800) { vizElement.style.width = '1100px'; vizElement.style.height = '627px'; } else if (divElement.offsetWidth > 500) { vizElement.style.width = '1100px'; vizElement.style.height = '627px'; } else { vizElement.style.width = '100%'; vizElement.style.height = '577px'; } var scriptElement = document.createElement('script'); scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js'; vizElement.parentNode.insertBefore(scriptElement, vizElement); </script>
HERE IS THE XAML CODE:
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core" mc:Ignorable="d" android:TabbedPage.IsSwipePagingEnabled="False" android:TabbedPage.ToolbarPlacement="Bottom" BarBackgroundColor="#00143D" BarTextColor="White" Visual="Material" SelectedTabColor="DeepSkyBlue" UnselectedTabColor="White" x:Class="AlgorixMobile.Views.FaturamentoeEbitdaView" Title="Faturamento Ebitda"> <TabbedPage.ToolbarItems> <ToolbarItem IconImageSource="diagrama.png" /> </TabbedPage.ToolbarItems> <TabbedPage.Children> <ContentPage Title="Colunas" IconImageSource="lucro.png" > <StackLayout> <WebView x:Name="Barras" HorizontalOptions="{OnPlatform Android=FillAndExpand, iOS=FillAndExpand}" VerticalOptions="FillAndExpand" /> </StackLayout> </ContentPage> <ContentPage Title="Linhas" IconImageSource="estatisticas.png"> <StackLayout> <WebView x:Name="Linhas" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /> </StackLayout> </ContentPage> <ContentPage Title="Ultimos 12 meses" IconImageSource="lucro.png" > <StackLayout> <WebView x:Name="Ultimos12" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /> </StackLayout> </ContentPage> <ContentPage Title="Anual" IconImageSource="lucro.png"> <StackLayout> <WebView x:Name="Anual" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" /> </StackLayout> </ContentPage> </TabbedPage.Children> </TabbedPage>
What I need is to make it work on IOS the same way as it is working at the Android, can anyone help ?
I mean is it possible to force the ios to recognize as a mobile device the HTML content if so how to make it shows on full screen mode?
Thanks in advance!
OnSizeAllocated
execute a command.MangoBox.RatioX
value.MangoBox
Changed, MangoBox
raises RaisePropertyChanged
.BaseLayerView.OnMangoBoxChanged
will be executed.However, step 4 only executed once when initialize and bind BaseLayerViewModel
.
I checked changing MangoBox
property does execute RaisePropertyChanged
, but BaseLayerView.OnMangoBoxChanged
does not executed.
public abstract class BaseLayerView<T> : MvxContentView { public static readonly BindableProperty MangoBoxProperty = BindableProperty.Create( propertyName: nameof(MangoBox), returnType: typeof(MangoBox), declaringType: typeof(BaseLayerView<T>), defaultValue: null, propertyChanged: OnMangoBoxChanged); public MangoBox MangoBox { get => (MangoBox)GetValue(MangoBoxProperty); set => SetValue(MangoBoxProperty, value); } static void OnMangoBoxChanged(BindableObject bindable, object oldValue, object newValue) { if (newValue is null) { return; } var baseLayerView = (BaseLayerView<T>)bindable; // code i want to execute when `MangoBox` changed. } }
I bind BaseLayerView
and BaseLayerViewModel
by DataTemplate
.
<DataTemplate x:Key="RectLayerView"> <forms:RectLayerView forms:MangoBox="{Binding MangoBox}" />
Here is binded BaseLayerViewModel
public abstract class BaseLayerViewModel<LayerModel> : MvxViewModel { protected T _layerModel; public MangoBox MangoBox { get => _layerModel?.MangoBox; } public T LayerModel { get => _layerModel; set => SetProperty(ref _layerModel, value, () => { _layerModel.MangoBox.PropertyChanged += (sender, e) => { RaisePropertyChanged(nameof(MangoBox)); }; RaisePropertyChanged(nameof(MangoBox)); }); } }
LayerModel
is used when BaeLayerViewModel
created.
public class LayerModel : MvxNotifyPropertyChanged { private MangoBox _mangoBox; public MangoBox MangoBox { get => _mangoBox; set => SetProperty(ref _mangoBox, value, () => { BindBoxEventHandler(); }); } public LayerModel(MangoBox box) { _mangoBox = box; BindBoxEventHandler(); } private void BindBoxEventHandler() { _mangoBox.XChanged += OnBoxPropertyChanged; } private void OnBoxPropertyChanged(object sender, MangoUnitChangedArgs e) { RaisePropertyChanged(nameof(MangoBox)); } }
public class MangoBox : MvxNotifyPropertyChanged { private readonly MangoPoint _point; private readonly MangoSize _size; public float RatioX { get => _point.RatioX; set => _point.RatioX = value; } public MangoBox(Standard2D standard, float x, float y, float width, float height) { _point = new MangoPoint(standard, x, y); _point.XChanged += OnXChanged; } public event EventHandler<MangoUnitChangedArgs> XChanged; private void OnXChanged(object sender, MangoUnitChangedArgs e) { XChanged?.Invoke(this, e); RaisePropertyChanged(nameof(RatioX)); RaisePropertyChanged(nameof(ValueX)); } }
I am using the following code for calling a function every 10 seconds.
var startTimeSpan = TimeSpan.Zero; var periodTimeSpan = TimeSpan.FromSeconds(10); var timer = new System.Threading.Timer((e) => { MyFunction(); }, null, startTimeSpan, periodTimeSpan);
MyFunction()
will execute every 10 seconds when the app is on the open state. When the app is in the background, that function is not invoking.
So how can I invoke a function when the app is in the background? Are there any NuGet packages for this or we need to do this using the dependency service?