Hi Team,
I would like to implement the synchronous ChipView control as like below image through native renderers.
I'm not sure how to draw the particular shapes in renderers.
Can anyone please help on this?
Thanks in advance,
Dinesh B
Hi Team,
I would like to implement the synchronous ChipView control as like below image through native renderers.
I'm not sure how to draw the particular shapes in renderers.
Can anyone please help on this?
Thanks in advance,
Dinesh B
I tries to programmatically scroll ScrollView
based on TouchEffect
, but when I do that it scrolls not properly, it scrolls instead of up it scrolls down and instead of down - up ...
Also from some point it stop scrolling ...
Here is code that I use to scroll programmatically:
TouchEffect touchEffect = new TouchEffect(); touchEffect.TouchAction += async (sender, args) => { await Scroller.ScrollToAsync(args.Location.X, args.Location.Y, true); }; Scroller.Effects.Add(touchEffect);
Hi, I am currently using Xamarin.forms.Datagrid to display data. I would like to ask if anyone know how to display multiple datagrid based on count? For example category A have 2 items and category B have 1 item, when user choose category A, I want to display 2 separate Datagrid for this 2 items. If user chooses B, it will only show 1 datagrid. How can I achieve this? Because the datagrid I am using is manually added in xaml, and also for rows and columns.
I did not add in the drop down list but example if User choose A in the drop down, it will display 2 data grid. If user choose B, it will display 1 data grid. What I want to achieve is to have the datagrid displayed on the same page where User chooses the category..... Is it possible? Please help thank you I am new to Xamarin and programming... I am not very good
This is my current codes
Mainpage.xaml
`
<dg:DataGrid ItemsSource="{Binding categoryA2}" HeaderHeight="0" BorderColor="#CCCCCC" SelectionEnabled="False" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" HeaderBackground="#E0E6F8" IsSortable="False" FontSize="16" HeaderFontSize="16"> <dg:DataGrid.Columns> <dg:DataGridColumn Title="Fruit" PropertyName="Name"/> <dg:DataGridColumn Title="Price" PropertyName="Price"/> </dg:DataGrid.Columns> <dg:DataGrid.RowsBackgroundColorPalette> <dg:PaletteCollection> <Color>#F2F2F2</Color> </dg:PaletteCollection> </dg:DataGrid.RowsBackgroundColorPalette> </dg:DataGrid> <dg:DataGrid ItemsSource="{Binding categoryA1}" HeaderHeight="0" BorderColor="#CCCCCC" SelectionEnabled="False" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" HeaderBackground="#E0E6F8" IsSortable="False" FontSize="16" HeaderFontSize="16"> <dg:DataGrid.Columns> <dg:DataGridColumn Title="Fruit" PropertyName="Name"/> <dg:DataGridColumn Title="Price" PropertyName="Price"/> </dg:DataGrid.Columns> <dg:DataGrid.RowsBackgroundColorPalette> <dg:PaletteCollection> <Color>#F2F2F2</Color> </dg:PaletteCollection> </dg:DataGrid.RowsBackgroundColorPalette> </dg:DataGrid>
`
Mainpage.cs
public MainPage()
{
InitializeComponent();
this.BindingContext = new ViewModel();
}`
Viewmodel
public class ViewModel
{
public ObservableCollection categoryA1 { get; set; }
public ObservableCollection categoryA2 { get; set; }
public ObservableCollection categoryB1 { get; set; }
public ViewModel() { categoryA1 = new ObservableCollection<Test>(); categoryA1.Add(new Test() { Name = "Orange", }); categoryA1.Add(new Test() { Price = "1.4" }); categoryA2 = new ObservableCollection<Test>(); categoryA2.Add(new Test() { Name = "Apple", }); categoryA2.Add(new Test() { Price = "1.2" }); categoryB1 = new ObservableCollection<Test>(); categoryB1.Add(new Test() { Name = "Spinach", }); categoryB1.Add(new Test() { Price = "1.0" }); } }
Test.cs
public class Test
{
public string Name { get; set; }
public string Price { get; set; }
}
Ok, so I was testing my application and I've noticed that in my listview when I have itens, like images or labels and this item has a GestureRecognizer ataching a command through a binding the scroll suffers a big decrease in performance. If I just remove the GestureRecognizer from my xaml the performance is acceptable, but with the command bindings the performance becomes laggy. I'm using MVVM. Has anyone experience the same? Maybe someone will ask for a piece of code, but I'm using only a class with some strings and a command and doing the binding to the xaml, nothing fancy. I've tested the Command binding to something null and the issue persists. Also, this doesn't seem to happen in the Tapped property, but how would I use it with MVVM (if possible of course)?
Hellooooooooo
I need help please
I am defining a method to avoid repeating the same code which is present in "CalculateDiff" many times whithin the same class (CompuChemXamlPage9)
BUT my "CalculateDiff" is not executed.
public partial class CompuChemXamlPage9 : ContentPage { private double diff; private int Numerator; private int Denominator; public void CalculateDiff(double diff) { if (diff >= 0.09 && diff < 0.1055) // diff == 0.100 { // 1 / 10 Numerator = 1; Denominator = 10; } else if (diff >= 0.1055 && diff < 0.118) // diff == 0.111 { } ... } private void Calculate(object sender, EventArgs e) { RCH = moleH / moleC; diff = Math.Abs(RCH - Math.Floor(RCH + 0.5)); CompuChemXamlPage9 myCompuChem = new CompuChemXamlPage9(); myCompuChem.CalculateDiff(diff); mX.Text = Numerator.ToString(); RCH = ((Math.Floor(RCH)) * Denominator) + Numerator; }
/WHY MY METHOD CalculateDiff is not executing???
I have just noticed that on Xamarin Forms Android, the text label on elements appears in ALL CAPS. Is this by design?
Regards,
Ian
Hi all. I've seen this post by @JamesMontemagno.
Nice one - so you can use the Microsoft Extensions in a consistent fashion across .Net Core apps and Xamarin, including a DI container and other goodies; and it's likely that more and more goodies will be added in future.
So I'd like to use that approach, and it's one less reason to take a dependency on a 3rd party MVVM framework.
However, looking at James' sample code, he's doing Navigation from within Views and not ViewModels, which people say breaks the purist MVVM approach.
Is that really so bad? If it's that bad, why hasn't XF been updated itself to include VM to VM Nav?
Thanks
Howard
So if I store settings using xamarin essentials secure storage for in app purchases for example. Will testflight and google prerelease apps storage be separate from production apps? or should I use different keys for storage of beta versions?
I am using custom fonts in my app. It works fine in android but in ios behaves weirdly. I have two labels with font size 50 and 32.
One with size 50 works fine but one with size 32 doesn't display correct font.
<Label Text="Welcome" FontSize="50" FontFamily="PunjabiFont"></Label> <Label Text="Welcome" FontSize="32" FontFamily="PunjabiFont"></Label>
Hi all,
I want to use PDFSharp.netstandard on Android and iOS to create and save a PDF-file (not viewing), but I get a error which I cannot place.
I have the following example code:
But now I get the following error when I want to create this PDF:
Does someone know how to use this on Android and iOS?
I never made a UWP app before, now using Xamarin made it.
But after I put it into real phone (Lumia 640XL). I found it's very slow.... My feel is slow as hell.
Open a Window may could use a lot of seconds....For example after login turn to main page:
MainPage main = new MainPage();
main.BindingContext = new MainPageViewModel();
CurrentNavigation.pushAsync(mian);
This will let me wait 5-10 seconds...Really? Ok, maybe there is some logic in ViewModel, like put some data from some static resources and put to the listview or bind some data to page like : {Binding }....But That's really too much than I every thought. even I saw some listview start load the list after page show up and you scroll it you can feel it. Maybe that's for performance inside of Xamarin. But really? I don't have any image.., even there is a Listview(just have some label and coupe of button in each listview item in the listview) after click start to load data. After I click it I'll wait to around 10 second ,and after the page got response, it will start loading the rest of the item. I mean after wait so long to stop freeze the page only load the top 20 items? and continue start load?(you can feel when scroll) ...
Anyway that's too bad...
Is there anyone could give me advice?
BTW: I'm not found any different with DEBUG and Release.... all slow...
I'm using the Xamarin.Form Shell Flyout.
When click item menu, from the second time, the page don't reload.
How do reload page (reload data) when click item menu in Xamarin.Form Shell Flyout?
<FlyoutItem Route="animals" Title="Animals" FlyoutDisplayOptions="AsMultipleItems"> <ShellContent Route="Monkeys" Title="Monkeys" Icon="tab_feed.png" ContentTemplate="{DataTemplate local:MonkeysPage}" <FlyoutItem/>
Hi everyone!
So what I am trying to do here is to open the app in the exact same point that I left it last time.
My app consists in just a CarouselPage
with several ContentPage
s, so I need to remember not only the current content page but also the position on the scrollview.
I am already able to open it in the right contentpage, but my issue is that if I close the app, every time I run it again, it doesn't scroll to the right position.
Instead, it opens on the top, and if I, for example, swipe forward to the next contentpage and then backwards (so the OnAppearing() executes again), then it scrolls to the expected position.
Is there any reason why the ScrollToAsync is not executed when the app is opened for the first time?
Thank you very much!
public partial class I : ContentPage { public I() { InitializeComponent(); } protected override void OnAppearing() { base.OnAppearing(); //Saves current page int CurrentChapter = MainCarouselPage.Capitulos.IndexOf(this); Preferences.Set("CurrentChapter", CurrentChapter); //Scrolls to las position int PosY = Preferences.Get("PositionY", 0); scrollView.ScrollToAsync(0, PosY , false); } private void ScrollView_Scrolled(object sender, ScrolledEventArgs e) { int PositionY = Convert.ToInt32(this.scrollView.ScrollY); Console.WriteLine("Position Y: " + PositionY); Preferences.Set("PositionY", PositionY); }
Going through a tutorial on building a map using Xamarin.Forms.Map. Managed to get my environment setup and working with a map using the below code in Visual Studio
`public partial class MapPage : ContentPage
{
public MapPage()
{
InitializeComponent();
var ms = MapSpan.FromCenterAndRadius(new Position(123, -123), Distance.FromMiles(1)); restaurantMap.MoveToRegion(ms); var cp = new CustomPin(); cp.Position = new Position(_lat, _lng); cp.Label = rest.Name; cp.Address = rest.Address; restaurantMap.Pins.Add(cp); } } public class CustomPin : Pin { public string Image { get; set; } public string ShopsNearby {get; set;} }`
So far all works as intended until i need to add more information to the popup when using Xamarin.Forms.Map.
I would now like to add further details for the restaurants when the icon is clicked including an image, so added a CustomPin class above. I cant find any examples of how i could build this in and how to build the appropriate popup to contain the additional information or image. Ive seen some similar threads but either they link to a 404 or the samples just didnt work with what i have above.
Could someone help me get back on track? Thanks
I have developed an app with Xamarin.Forms using zxing scanner to scan QR codes. The app uses front camera to scan QR codes and app will be keep open all time. App doesn't go to background. It is very simple and has only 3 pages that is scanning page (HomePage), success page & unsuccess page. After a successful or unsuccessful scan it sets the App's MainPage to scan page. It keeps working for many cycles until about 30 minutes but suddenly stops firing the Handle_On_Scan
event. I can't figure out why. What could be happening and is there a way to fix this? Please help me.
public HomePage() { InitializeComponent(); BindingContext = viewModel; //Scanner.AutoFocus(); Scanner.Options = new ZXing.Mobile.MobileBarcodeScanningOptions { DelayBetweenAnalyzingFrames = 200, DelayBetweenContinuousScans = 200, PossibleFormats = new List<BarcodeFormat> { BarcodeFormat.QR_CODE }, TryHarder = true, UseFrontCameraIfAvailable = true }; }
I am looking for a way to force the user to have to re-enter their pin code to check that they are the person using the phone currently
I am trying to use the ToolbarItems to be able to navigate in my app. I am using the Order="Secondary" to have the ellipse icon and a drop menu. I have been using a lighter color for my BarBackgroundColor and the ellipse icon cannot be seen because it it white. How can I change the ellipse icon in a secondary toolbar item to black??? I have been looking everywhere for what should be a fairly accessible option.
I have listview which has a story with around 50-60 rows. I want to slowly scroll listview automatically.
So that user can continue to read without manually scrolling.
Hi
I have added style sheet to my Xamarin Forms app. I have;
<Application ...">
<Application.Resources> <StyleSheet Source="/Assets/app.css" /> </Application.Resources>
I am getting exception on;
global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(App));
in class App, method InitializeComponent.
I have tried various variations of path and moved css files to root etc but no luck. What am I doing wrong? The css seems to be at correct path. Screen below.
Thanks
Regards