Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 77050 articles
Browse latest View live

Shell Flyout footer template

$
0
0


How can I do this
Upload some photos below


MVVM Best Practice regarding reusing ViewModels

$
0
0

Hi, I am just getting my head around MVVM and I have a quick question about ViewModels.
Can or should I use one ViewModel across multiple XAML pages?
Not one instance at runtime but one code file at design time.
I have two pages where the underlying model is the same, say 'widget'. I have a WidgetViewModel that manipulates the widget data for the UI on the first page. The second page also displays widget data but in a slightly different way - can add just add new properties and commands to my WidgetViewModel for the second page or should I create a brand new ViewModel for the second page?
I guess what I am asking it is best practice to have an exact one to one relationship between your Views and ViewModels when building an MVVM app?
Cheers
John

Custom View inside another custom view

$
0
0

Hi,
Am having a custom view..
1. Calculator view(Custom View) (Have 10 buttons) each buttons clicks called to same event when ever user clicks each button need to consolidate the values example (user press 456 am storing 456 in a normal property like below.)
public string CalculatedValue { get; set; }
void OnSelectNumber(object sender, EventArgs e)
{
Button button = (Button)sender;
string pressed = button.Text;
this.CalculatedValue += pressed;
}

2. Material Calculation (CustomView) This file will have one label and one user-control (referred the calculator view created at point 1) Like below
    <Label Text="00" x:Name="calvalue"   TextColor="Black"/>
    <UserControls:CalculaterView   x:Name = "calculaterView" />

Now my UI is rendering properly and also when every click the buttons OnSelectNumber event is triggered value is stored in this property CalculatedValue

** Question** How to show the value of this property CalculatedValue on my Label control of Material Calculation view.

Change layout based on accessibility font scale

$
0
0

I have an app that uses a grid with multiple columns for display of information. With standard font sizes the grid works well but when the font size is scaled up it would look better to switch to a layout that displays the information in a single column.

Is there a way in Xamarin Forms to change the layout based on the what font scale is set on the device. I need a solution for Android and iOS.

Thanks!

How do I hide the Tabs of TabbedPage when clicking a nested NavigationPage?

$
0
0

There is this great article on how to set up a TabbedPage:
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/navigation/tabbed-page

It shows how a page of a tab can be set up with a NavigationPage, which of course shows a Back button on any of it's children - So far so good. BUT, it's majorly flawed!

Once you click to open a child of NavigationPage (which renders Back button), the tabs need to disappear! They don't. How do we hide the tabs?

Referring to the screen cap gif below: Say I have a couple static pages in a tab, and also one tab is a Navigation Page. If I click to a tab ("Schedule"), then click a navigation (child) to get to the child page ("Upcoming appointments"), it renders a back button as expected. BUT... the tabs are still visible! Now if you click another tab (like "Today" or "Settings") WHILE the child of "Schedule" tab is open, you get into a bad state where the back button does NOTHING. You have to click on the originating parent tab ("Schedule") before you can click back and dismiss the navigation child page.

ugh.... really? And this is an official example posted in the docs and sample files? Sheesh.

How do we fix this? How do we hide the tabs when the child NavigationPage is loaded and back button rendered?

Real world example of what I want:
Open Facebook on your phone, see tabs while viewing your feed. Tap on the Alert tab (bell icon) and tap a post, and you see the tabs disappear, the child page you navigated to takes the FULL screen and and the back button appears.

Label TextType = "Html" does not honor the FontFamily in iOS

$
0
0

If I set the TextType = "Html" for a Label, the Label will ignore the FontFamily only in iOS, everything is as expected in Android. The font family is correct, once the TextType is set to "Text" the correct font shows.

[BUG]Shell Naviagtion Crash iOS 13 When RemovePage in NavigationStack.

$
0
0

When i use "CurrentApplication.MainPage.Navigation.RemovePage(CurrentApplication.MainPage.Navigation.NavigationStack[CurrentApplication.MainPage.Navigation.NavigationStack.Count() - 2]);"

and CurrentApplication.MainPage.Navigation.PopAsync(false); app Crash.Any Fix This.Help me

Problem with threads

$
0
0

Hi. I have a problem with Task running on another thread. I want to insert page before in stack and load it on different thread because it wasn't working quite well without it. This attempt give me this error : Android.Util.AndroidRuntimeException: 'Only the original thread that created a view hierarchy can touch its views.'
Could you please help me with this problem ?

await Task.Run(() =>
                {
                    Navigation.InsertPageBefore(new NavigationPage(new View.DLHY_USER("Lukáš")), this);
                });

How navigate to a Content Page from Rg popup on clicking a button

$
0
0

I have created a popup using rg.plugins.popup. In my popup i have a button so when i click that button want to display a report(ie, form is contentpage)
so its showing error when im using Navigation.PushAsync() .
whil using PopupNavigation.Instance.PushAsync() this also showing error as my form is not a popup .

Please help !.....

Tabbed bar contains extra space in iPhone X

$
0
0

Hello All,

I am trying to bind tab page inside tab page in iPhone X using Xamarin.Forms.

Below is my code of child tab page.
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="CustomTabbedPage.MainPage" xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core" android:TabbedPage.ToolbarPlacement="Bottom"> <TabbedPage.Children> <ContentPage Title="Top Neuigkeiten" Icon="ic_home.png" /> <ContentPage Title="HR Neuigkeiten" Icon="ic_favorite.png" /> <ContentPage Title="Meine Neuigkeiten" Icon="ic_people.png" /> </TabbedPage.Children> </TabbedPage>

But child tab bar contains extra space in bottom as shown in image.

Do anyone have any idea regarding this?
Thanks.

How i can make a route and then navigate like google maps or uber?

$
0
0

I can from my app open google maps but the client don't wanna that. He want a map in the app

Disable Tabbed Page Icon

$
0
0

Hi everyone !

I have a tabbed page. I don't want to use an icon on my Tabbed Page. On Android, it looks automatically iconless. But on the iOS side, the icon appears blank above the tab text. So my goal is the iconless tabbed page for iOS and Android.

How can i solved ?

Thanks in advance !

Implementing acr.UserDialogs in Xamarin.Forms with mvvmlight

$
0
0

For school we are developing a mobile app with Xamarin Forms. We use mvvmlight in the project.

Now I was looking around for how to show dialogs, alerts etc. and stumbled upon acr.UserDialogs which has everything we need.

I added UserDialogs.Init(this); to my MainActivity.cs

And when I try to register it in my ViewModelLocator:

SimpleIoc.Default.Register<IUserDialogs, UserDialogs>();

This doesn't work because UserDialogs is Static type.

I found a similiar question Here Which gives the following suggestion

SimpleIoc.Default.Register(UserDialogs.Instance);

But this doesn't work neither.

Am I doing something wrong or missing something? Anyone got any other suggestions?

Thanks

How to make a contentpage refresh when a popup closes

$
0
0

Good day guys,
I have a situation where i am using Rg.Plugins.Popup ( awesome plugin by the way) for filtering but after i close it im not sure how to call a refresh.
i assumed the onappear would of kicked in and done a refresh. is there anyway i can get the current page and call it from the popup page before closing?

Android font size gets overridden by native Android settings

$
0
0

I am setting my font size using the NamedSize enumeration. In iOS the font displays as the set size regardless of the font size set in the os settings. This however is not the case for Android. If I set my NamedSize to medium and the Android settings have font size set to large, the font will be large. Even when I set it to an int value, the Android overrides it with the font size from settings which in turn makes the app look terrible in some situations. Does anyone have a way to have the font size not get overridden by the Android native settings?


How to pick the file from Google Drive in android?

$
0
0

Can anyone guide me on how to pick the file from Google Drive in android?

Xamarin Forms Call Screen UI (Free)

Xamarin.Forms GTK compile for ARM

$
0
0

Anyone know how to compile Xamarin.Forms GTK # application for Raspberry pi running Raspbian?
I'm developing under Visual Studio with Windows 10 and cannot compile it to ARM platform.

sorry please delete that thread

How to pick the file from Google Drive in android?

$
0
0

Can anyone guide me on how to pick the file from Google Drive in android?

Viewing all 77050 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>