xamarin.android

Calling a method from a different class that uses variables outside the method

血红的双手。 提交于 2019-12-11 16:04:43
问题 I have a problem. I have a method in a class like this: public void UpdateActionBar(int CurrentFragmentNum) { if (CurrentFragmentNum == 1) { btnBack.Visibility = ViewStates.Invisible; btnNext.Visibility = ViewStates.Invisible; } else { btnBack.Visibility = ViewStates.Visible; btnNext.Visibility = ViewStates.Visible; } if (CurrentFragmentNum == 3) { btnNext.Text = "Finish"; } else { btnNext.Text = "Next"; } } Now in another class I call this method like this: new ActionBar_Setup()

Using vlc player in xamarin.android project

主宰稳场 提交于 2019-12-11 15:58:13
问题 use LibVLCSharp in my project cause the video pixeled and grey screen I tried to add file-caching=1500 to media player with no success and you can see my code below this.VideoPath = extras.GetString(INTENT_KEY_PARAM_VIDEO_PATH); Core.Initialize(); _libVLC = new LibVLC(); _mediaPlayer = new MediaPlayer(_libVLC); _videoView.MediaPlayer = _mediaPlayer; var mediaUri = Android.Net.Uri.Parse(this.VideoPath); var m = new Media(_libVLC, mediaUri.ToString(), FromType.FromPath); var configuration = new

How to pass two inputs to a value converter in xamarin android

霸气de小男生 提交于 2019-12-11 15:56:27
问题 What is Happening : I am passing one boolean value to a converter and performing some action(Changing Drawable). What I am trying to do : How to pass two boolean values to a converter and perform some action. Is this possible How ? If this is not the right approach by passing two inputs to a single value converter, then how to resolve this CONVERTER : CruiseShipIndicatorValueConverter.cs public class CruiseShipIndicatorValueConverter : MvxValueConverter<bool, int> { protected override int

Auto-scaling label fontsize in Xamarin

我是研究僧i 提交于 2019-12-11 15:49:13
问题 <Label x:Name="mainLabel" Grid.Row="0" Grid.Column="0" FontSize="50" Grid.ColumnSpan="3" Grid.RowSpan="2" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand" /> I am making a phone dialing interface and i have a label that outputs the numbers that are pressed. Question : How can I make the font size of the label decreases and increases depending on the numbers typed so that it will fit on the label? I tried googling all day but all the samples are outdated. I am using the

How to get out all routes [PlaceMark, LineString] in a KML-file when added to Google Maps? [C#]

大憨熊 提交于 2019-12-11 15:40:44
问题 Using this plugin: https://github.com/sushihangover/SushiHangover.Android.Maps.Utils I am successfully adding a route to a my Google Map by adding a kml-layer to it. I foreach the lat, lng and via a Polyline I create a line! The problem I have is that my KML-file however has multiple routes and with my current code only one of the routes gets added to the map. How do I adjust my code in order to get every single route stored in my KML-file? My KML looks like this: <Folder> <name>Tracks</name>

How to draw 1/3 circle on Xamarin forms?

核能气质少年 提交于 2019-12-11 15:35:52
问题 I'm designing a layout as below with Xamarin Forms . 1) How do we draw such a layout? and 2) How do we draw 1/3 circle? Please help me! Reference : Draw Circle in Xamarin form 回答1: If you just want to set the CornerRadius of bottom-left and bottom-right. You can use the Custom Renderer . in Forms ,create a subclass of BoxView public class MyBoxView:BoxView { } in xaml <StackLayout VerticalOptions="StartAndExpand" HorizontalOptions="CenterAndExpand"> <local:MyBoxView BackgroundColor = "Red"

After updating MvvmCross 5.2 I have error Fragment already active

隐身守侯 提交于 2019-12-11 15:30:52
问题 I have a problem after updating to the new MvvmCross 5.2 . I have forced uninstalled MvvmCross.Droid.Shared and after update all packages. I then got some errors with MvxFragment , so I replaced it with MvxFragmentPresentation . Additionally, I replaced MvxCachingFragmentCompatActivity with MvxAppCompatActivity and I'm now using the new MvxAppCompatViewPresenter . All works well, and the app running good. Except after I select logout in menu I'm taken to the LoginViewModel and when I want

How to build a Xamarin.Android project without managed executables?

强颜欢笑 提交于 2019-12-11 15:29:41
问题 I'm tinkering with Xamarin.Forms on Visual Studio Community for Mac version 7.3.2 What I'm trying to accomplish is to convert all managed code to native executables using these options in MyApp.Droid.csproj : <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk> <AotAssemblies>true</AotAssemblies> <EnableLLVM>true</EnableLLVM> </PropertyGroup> EmbedAssembliesIntoApk does embed the assemblies into the apk so I've

Xamarin.Android and Spinner binding with ReactiveUI

元气小坏坏 提交于 2019-12-11 15:27:36
问题 I'm trying to bind to a Spinner using ReactiveUI in a Xamarin.Android application. To add items to the Spinner , I need to use ArrayAdapter . But ArrayAdapter needs Android.Content.Context . Should I pass it into the ViewModel? Anyone know about an application written in Xamarin.Android, which uses ReactiveUI, where I could look inspiration? The ReactiveUI documentation only has a reference to a sample application written for iOS. View <?xml version="1.0" encoding="utf-8"?> <RelativeLayout

Navigation in Xamarin Forms with Custom Movement between pages

半腔热情 提交于 2019-12-11 15:08:11
问题 Hi Xamarin Developers, So I have one requirement where user go From Page1 -> Page2 -> Page3 -> Page4 and after Page4, He has to return back to Page2 and If he press back button he should navigate it back to Page1. How to achieve this in Xamarin Forms.? I tried like this, Navigation.RemovePage(Navigation.NavigationStack[Navigation.NavigationStack.Count - 1]); _ = Navigation.PopAsync(true); But it's giving weird animation and not working properly. Please help me on this. 回答1: First of all: If