Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Master details page with dynamic menu list

$
0
0

Hi all,
I would like to change the menu items in master detail page dynamically (i.e.,) Initially I am having 3 menu items on login page, Once user is successfully logged in, i want the menu with 4 items?

MasterPage. xaml

MasterPage.xaml.cs

public partial class MasterPage : ContentPage
{
public ListView listView { get { return lstScreens; } }
public MasterPage()
{
InitializeComponent();

        var masterpageItem = new List<ClassFiles.MasterPageItem>();
        masterpageItem.Add(new ClassFiles.MasterPageItem
        {
            Title="Login",
            TargetType = typeof(Pages.LoginPage)
        });

        masterpageItem.Add(new ClassFiles.MasterPageItem
        {
            Title = "Register",
            TargetType = typeof(Pages.RegisterPage)
        });

        masterpageItem.Add(new ClassFiles.MasterPageItem
        {
            Title = "Menu Item 1",
            TargetType = typeof(Pages.MenuPage1)
        });
        listView.ItemsSource = masterpageItem;
    }

Note:
I got the following reference https://stackoverflow.com/a/37742273. I don't understand the answer posted.

Thanks in advance


Is there any QR code scanner plugin for android, iOS, windows RT and windows phone?

$
0
0

We require a plugin which should run on android, iOS, windows RT and windows phone device.
Any plugin or help is appreciated.

Classic API and MacOS High Sierra

$
0
0

Hi,

I get this error: "Failed to Soft Linked: /System/Library/Frameworks/Contacts.framework/Contacts" when running my Classic API app on High Sierra. This happens on the NSApplication.Init(). I do realize the Contacts.framework is only 64bit, but so was it on macOS Sierra. Is there any reason why it is now being loaded under macOS High Sierra?

Best regards,

P.S.: Sorry I posted and incomplete post first, I kinda messed up when adding tags.

Binding and listview

$
0
0

Hi ,
I know, maybe it's a stupid question, but I use xamarin from two weeks and I'm learning.

Then... I have a problem .
I want to do a chat in my app and i want to use listview for the chat page.
So, i have an ObservableCollection of CustomCell where I add a new CustomCell with the Text in the entry everytime i click on send button.
In the CustomCell there is a Label where i need display this text. I wanted bind this label but i don't know how.
I tried set a public string Message { get; set; } in CustomCell class and set this value when i create a new CustomCell... and i set in xaml page a label with text binding Message... but maybe i lost a passage.

This is a part of code.

ChatPage Class

private ObservableCollection<CustomCell> source = new ObservableCollection<CustomCell>();

 private void Send_Clicked(object sender, EventArgs e)
        {
           source.Add(new CustomCell {Message = msg.Text });
           listMain.ItemsSource = source;
           listMain.ItemTemplate = new DataTemplate(typeof(CustomCell));
        }

ChatPage XAML

<ListView x:Name="listMain">
        <ListView.ItemTemplate>
            <DataTemplate >
                <ViewCell>
                    <StackLayout>
                        <Grid>
                            <Label Text="{Binding Message}"  />
                        </Grid>
                        <BoxView></BoxView>
                    </StackLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

CustomCell Class

public class CustomCell : ViewCell
    {
        public string Message { get; set; }
    private Label Label_UserMessage;
     public CustomCell ()
        {
        ....
        ....
         Label_UserMessage = new Label()
            {
                Text = Message,
                VerticalOptions = LayoutOptions.StartAndExpand
            };
    }
    }

Ty all for the answers and sorry for my english.

Split screen in 3 equals parts

$
0
0

Hello,

Is there a way to split the screen in three equal parts, without using relative or absolute layout? Or grid layout? Can we have StackLayout one under another?

Thx.

Xamarin Live Player: Failed to Resolve Assembly

$
0
0

Hello,

My code runs perfectly when I run/deploy it in emulators/physical devices. However, when I run it in Xamarin Live Player. I'm getting this error. I followed all the instructions in the setup of XLP. Please let me know how can I resolve this issue. I really wanted to try this feature out.

Thank you

Android.Views.InflateException: Binary XML file line #1: Error inflating class fragment

$
0
0

I'm using google maps V2, and tested on two LG devices with android 6 and when I open the map of the error below:

Android.Views.InflateException: Binary XML file line #1: Error inflating class fragment

I tested on a tablet with Android 4 and it works, I also tested on other devices with Android 6 different from the LG brand and it works as well.

The activity of the map I extend the class of Activity itself and not of Fragment and the error of the good at the time of giving a setcontextview in the layout that has this fragment of the map.

My layout file is:

<?xml version="1.0" encoding="utf-8"?>




My manifest file is correct too, since other devices work, only giving problem in LG devices with android 6.

UIButton is not showing up the IOS renderer

$
0
0

Hi,
I have the following code. I am able to see the image and rectangle around it But I am not able to see the button.
Can you please let me know why it is not working?

public class ImageCorrectionRenderer : PageRenderer
    {



        ImageCorrection imageCorrection;
        UIScrollView scrollView;
        UITextView textView;

        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);
            imageCorrection = e.NewElement as ImageCorrection;
            var view = NativeView;
        }

        public override void TouchesBegan(NSSet touches, UIEvent evt)
        {
            var touch = touches.AnyObject as UITouch;

            Console.WriteLine(touch);
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // set the background color of the view to white
            UIImageView imageView;
            scrollView = new UIScrollView(
                new CGRect(0, 0, View.Frame.Width
                                        , View.Frame.Height));
            View.AddSubview(scrollView);

            // create our image view
            imageView = new CropImageView(new CGRect(0, 0, View.Frame.Width
                , View.Frame.Height));

            imageView.Image = UIImage.FromFile(imageCorrection.fourPointData.filePath);
            imageView.ContentMode = UIViewContentMode.ScaleToFill;
            scrollView.AddSubview(imageView);
            // set allow zooming
            scrollView.MaximumZoomScale = 3f;
            scrollView.MinimumZoomScale = .1f;
            scrollView.ViewForZoomingInScrollView += (UIScrollView sv) =>
            {
                return imageView;
            };

            FourPointData fourPointData = imageCorrection.fourPointData;
            Xamarin.Forms.Point[] points = fourPointData.points;
            CGRect position = imagePositionInImageView(imageView);
            CGPoint[] cgPoints = new CGPoint[points.Length];

            nfloat horizontalRatio = imageView.Frame.Size.Width / fourPointData.width;
            nfloat verticalRatio = imageView.Frame.Size.Height / fourPointData.height;

            for (var counter = 0; counter < points.Length; counter++)
            {
                cgPoints[counter] = new CGPoint((horizontalRatio * points[counter].X), position.Y + (verticalRatio * points[counter].Y));
            }
            var size = new SizeF((float)View.Frame.Width, (float)View.Frame.Height);
            PointF locationOne = new PointF((float)imageView.Frame.X, (float)imageView.Frame.Y);
            DraggablePolygon draggablePolygon = new DraggablePolygon(locationOne, size, cgPoints);
            imageView.AddSubview(draggablePolygon);

            UIButton uiButton = UIButton.FromType(UIButtonType.System);
            uiButton.SetTitleColor(UIColor.Black, UIControlState.Normal);
            uiButton.SetTitle("Crop Image",UIControlState.Normal);
            uiButton.TouchUpInside += delegate {
                new UIAlertView("Touch1", "TouchUpInside handled", null, "OK", null).Show();
            };
            imageView.AddSubview(uiButton);

Receive push notifications when app is not running.

$
0
0

Hi,

I am building an aap that receives push notifications. I can recieve them when my app is running but not when my app is inactive. How can I solve this?

[BroadcastReceiver(Permission = "com.google.android.c2dm.permission.SEND")]
    [IntentFilter(new string[] { "Android.Content.Intent.ActionBootCompleted" })]
    [IntentFilter(new string[] { "com.google.android.c2dm.intent.RECEIVE" }, Categories = new string[] { "nl.ibridge.metapp" })]
    [IntentFilter(new string[] { "com.google.android.c2dm.intent.REGISTRATION" }, Categories = new string[] { "nl.ibridge.metapp" })]
    [IntentFilter(new string[] { "com.google.android.gcm.intent.RETRY" }, Categories = new string[] { "nl.ibridge.metapp" })]

    public class GCMBroadcastReciever : BroadcastReceiver
    {
        public override void OnReceive(Context context, Intent intent)
        {
            if (!string.IsNullOrEmpty(intent.GetStringExtra("title")))
            {
                NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
                .SetContentTitle(intent.GetStringExtra("title"))
                .SetContentText(intent.GetStringExtra("message"))
                .SetSmallIcon(Android.Resource.Drawable.ic_launcher);

                NotificationManager notificationManager = (NotificationManager)context.GetSystemService(Context.NotificationService);
                notificationManager.Notify(1, builder.Build());
            }
        }
    }

Missing namespace of existing library, Xamarin Android

$
0
0

Cross-post from StackOverflow


I have an auxiliar project that contains Java libraries used in the project. That project contains a folder with a mbwaysdk.jar and a WheelPicker-1.1.1.aar in it.

After building that project, it generates the .NET classes for the mbwaysdk.jar without any problem, but the classes of WheelPicker-1.1.1.aar don't show up. I've checked and the obj/Debug/generated/src folder contains the file classes for the mbwaysdk.jar and WheelPicker-1.1.1.aar libraries.

Within Visual Studio, the namespace Com.Aigestudio.Wheelpicker isn't recognized, although the project succesfully builds and deploys to devices, and any usage of the Com.Aigestudio.Wheelpicker views and methods works. While in debug I'm able to inspect the object, but unable to navigate to the class.

What can be causing this issue?

How can Access view cell controls(like hiding label) in button click( also inside view cell) click ?

$
0
0

This is my xaml file here I have image tapped event ,if image tapped have to start progress view


                    <Label x:Name="PageNo"  Text="{Binding PageNo}" BackgroundColor="#fee9cf"
                    TextColor="Black" FontSize="10" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"
                    RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Factor=1,Constant=0}"
                    RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Factor=0,Constant=0}"
                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=0,Constant=50}"
                   RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,Property=Height,Factor=0,Constant=40 }"></Label>

                        <Label  BackgroundColor="#d6d9de"   x:Name="lblbg"
                    TextColor="Black" HorizontalTextAlignment="Center" FontSize="10" VerticalTextAlignment="Center"

                     RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView,ElementName=PageNo,Property=X,Factor=2,Constant=50}"
                    RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView,ElementName=PageNo,Property=Y,Factor=0,Constant=0}"
                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView,ElementName=PageNo,Property=Width,Factor=0,Constant=50}"
                   RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView,ElementName=PageNo,Property=Height,Factor=0,Constant=40 }"
                        ></Label>
                   <Image Source="Download.png"  x:Name="imgindexdownload" Scale=".7"
                    RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=X,Factor=0,Constant=60}"
                    RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Factor=0,Constant=0}"
                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=0,Constant=30}"
                    RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,Property=Height,Factor=0,Constant=40 }">
                                <Image.GestureRecognizers>
                                 <TapGestureRecognizer Tapped="Download_Tapped" />
                                  </Image.GestureRecognizers>
                    </Image>
                       <ProgressBar x:Name="progressBar1" Progress="0,5" WidthRequest="10"

RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,
Property=X, Factor=0,Constant=57}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,
Property=Y, Factor=0 , Constant=34}"

    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,
                                    Property=Width, Factor=.1 }"

         RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,
                                    Property=Width, Factor=.1}" />
                    <Label x:Name="Title" Text="{Binding Title}" BackgroundColor="Transparent"
                    TextColor="Black" HorizontalTextAlignment="End" VerticalTextAlignment="Center"  HorizontalOptions="FillAndExpand"
                    RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=0.23,Constant=0}"
                    RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Factor=0,Constant=0}"
                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=0,Constant=230}"
                   RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,Property=Height,Factor=0,Constant=40 }"
                        ></Label>

                    <Label x:Name="Index" XAlign="End" Text="{Binding Index}" BackgroundColor="#242930"
                    HorizontalTextAlignment="Center"  VerticalTextAlignment="Center" TextColor="White"  HorizontalOptions="FillAndExpand"
                        RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=.88,Constant=00}"
                    RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent,Property=Y,Factor=0,Constant=0}"
                    RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent,Property=Width,Factor=0,Constant=50}"
                   RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent,Property=Height,Factor=0,Constant=40 }"></Label>


        </RelativeLayout>

In code behind

void Download_Tapped(object sender, System.EventArgs e)
{
var b = (Image)sender;
// ProgressBar progress =lstview.FindByName("progressBar1");

        ProgressBar progress= this.FindByName<ProgressBar>("progressBar1");
        progress.IsVisible = false;
        //var t = (ProgressBar)b.ParentView;
        //var t = b/.CommandParameter;
        //((ContentPage)((ListView)((StackLayout)b.ParentView).ParentView).ParentView).DisplayAlert("Clicked", t + " button was clicked", "OK");
        //b.IsVisible = false;
       DisplayAlert("Alert","Do you want to Download?","ok","cancel");
        //        this.FindByName<ProgressBar>("progressBar1").IsVisible = true;
        //rootview.FindByName<Image>("imgindexdownload").IsVisible = false;

    }

Build succeeded but unable to deploy

error MSB4025: while adding google-services.json

$
0
0

The project file could not be loaded. Data at the root level is invalid. Line 1, position 1

What would cause the TabbedPage to show a drop-down selection?

$
0
0

I have a Shared Xamarin Forms app where I use compile directives to show ads.

I have two android projects (one with ads and one without) where I make heavy use of linked files to share code.

I am surprised that the app without ads is showing tabbed spaced across the top where the app with ads is showing a drop-down selection for the different tabs. See the attached images to see how this is represented on the same emulator.

Before I start the time-grinding isolation effort I want to get some thoughts on what could be causing this behavior. FYI - the image sizes for launcher are both 72x72 and I "fingerprinted" them to know that they are both coming from drawable-hdpi

Thanks for your time, Paul

Xamarin Android Binding .aar manifest

$
0
0

Hello!

I'm currently working on creating a binding for an SDK that is in the .aar format. I have successfully wrapped the library for Xamarin and began using the binding in a sample project where I noticed a few issues. I noticed that when I tried to launch activities that were included in the SDK I would receive a "Android.Content.ActivityNotFoundException".

I got around this issue by declaring the activity in my sample app's manifest, but I feel like doing this isn't the correct way since they should already be declared by the SDK. Also, I had to declare services, permissions, etc.. that are included in the SDKs manifest in my sample app's manifest. Essentially doing a manual merge between the two.

So, my question is there anyway to have the manifest associated with the SDK and the manifest associated with project consuming the binding to be merged? Or someway for the project consuming the binding to inherit the SDK's manifest properties. Or perhaps this is how the binding works and I have to declare everything in my sample app's manifest. Any feedback on this would be greatly appreciated.

These are the sets I went through to create the binding/sample app:

  • Create Android Binding Library Project
  • Added SDK .aar file with build action "LibraryProjectZip"
  • Included any reference jars with build action "EmbeddedReferenceJar"
  • Compiled and fixed any binding errors in "Metadata.xml"
  • Created sample app and included binding reference

Thanks for your time,
Robert


App crash in debug mode on Jelly Bean device

$
0
0

Hi,
In my project I use AppCompatActivity as my MainLauncher.
I debug my app on two device (one with Lollipop and one with Marshmallow). The app work and I can debug.
I try to debug on another device with Jelly Bean (4.1.2) and the app crash on start with this error
"Cannot load type MyActivity" (MyActivity is the type of my Activity with MainLauncher set to true).

This happen only in debug mode, I try in release mode and the app start without problem.

I try to uninstall the app, rebuild the solution, clean bin/obj folder, reinstall monoshared runtime in the device and so on.
Can you help me?

How to return generic data from method?

$
0
0

//Get all event details
public IEnumerable GetAllData()
{
return (from t in _sqlconnection.Table() select t).ToList();
}

I have method that return the all rows from database. but i want to make it generic. Like whatever table i pass in method that returns the all the rows from table.
How can i do it?

App runs in debug mode but not in release mode

$
0
0

AndroidRuntime Caused by: android.runtime.JavaProxyThrowable:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
Microsoft.Practices.ServiceLocation.ActivationException: Cannot register: No public constructor found in MainViewModel.

at GalaSoft.MvvmLight.Ioc.SimpleIoc.GetConstructorInfo (System.Type serviceType) [0x0012d] in :0
at GalaSoft.MvvmLight.Ioc.SimpleIoc.Register[TClass] (System.Boolean createInstanceImmediately) [0x000a5] in :0
at GalaSoft.MvvmLight.Ioc.SimpleIoc.Register[TClass] () [0x00000] in :0
at VendorEzeeAccessApp.ViewModel.ViewModelLocator..ctor () [0x0002f] in :0
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in :0
--- End of inner exception stack trace ---
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00017] in :0
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000a8] in :0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in :0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in :0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in :0
at System.Activator.CreateInstance (System.Type type) [0x00000] in :0
at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode) [0x00253] in :0
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x000b1] in :0
at Xamarin.Forms.Xaml.ElementNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00089] in :0
at Xamarin.Forms.Xaml.RootNode.Accept (Xamarin.Forms.Xaml.IXamlNodeVisitor visitor, Xamarin.Forms.Xaml.INode parentNode) [0x00054] in :0
at Xamarin.Forms.Xaml.XamlLoader.Visit (Xamarin.Forms.Xaml.RootNode rootnode, Xamarin.Forms.Xaml.HydratationContext visitorContext) [0x0005a] in :0
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.String xaml) [0x0005d] in :0
at Xamarin.Forms.Xaml.XamlLoader.Load (System.Object view, System.Type callingType) [0x0002f] in :0
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml] (TXaml view, System.Type callingType) [0x00000] in :0
at VendorEzeeAccessApp.App.InitializeComponent () [0x00000] in :0
at VendorEzeeAccessApp.App..ctor () [0x00006] in :0
at VendorEzeeAccessApp.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x0003f

App.xaml.cs

private void navigationConfiguration()
{
nav = new NavigationServiceVn();

        if (!SimpleIoc.Default.IsRegistered<INavigationServices>())
        {


            //Registering the navigation for each page to navigation service
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.MainPage, typeof(MainPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.RegistrationPage, typeof(RegistrationPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.SearchPage, typeof(SearchPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.POItemsListPage, typeof(POItemsListPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.DetailsPage, typeof(DetailsPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.AccountInfoPage, typeof(AccountInfoPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.ForgotPasswordPage, typeof(ForgotPasswordPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.AddAdminPage, typeof(AddAdminPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.AboutPage, typeof(AboutPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.ChangePasswordPage, typeof(ChangePasswordPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.ViewAdminsPage, typeof(ViewAdminsPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.AdminVendorApprovalPage, typeof(AdminVendorApprovalPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.WebViewPage, typeof(WebViewPage));
            ((NavigationServiceVn)nav).Configure(ViewModelLocator.WebViewPageIOS, typeof(IOSWebViewPage));

            SimpleIoc.Default.Register<INavigationServices>(() => nav);
        }
        else
        {
            nav = SimpleIoc.Default.GetInstance<INavigationServices>();

        }

ViewModelLocator.cs

public ViewModelLocator()
{
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

        **SimpleIoc.Default.Register<MainViewModel>();**
        SimpleIoc.Default.Register<RegistrationViewModel>();
        SimpleIoc.Default.Register<SearchViewModel>();
        SimpleIoc.Default.Register<POItemsListViewModel>();
        SimpleIoc.Default.Register<DetailViewModel>();
        SimpleIoc.Default.Register<SettingsViewModel>();
        SimpleIoc.Default.Register<ForgotPasswordViewModel>();
        SimpleIoc.Default.Register<MenuViewModel>();
        SimpleIoc.Default.Register<AdminVendorApprovalViewModel>();
    }

   ** public const string MainPage = "MainPage";**
    public const string RegistrationPage = "RegistrationPage";
    public const string SearchPage = "SeachPage";
    public const string POItemsListPage = "POItemsListPage";
    public const string DetailsPage = "DetailsPage";
    public const string ForgotPasswordPage = "ForgotPasswordPage";
    public const string AccountInfoPage = "AccountInfoPage";
    public const string AddAdminPage = "AddAdminPage";
    public const string AboutPage = "AboutPage";
    public const string ChangePasswordPage = "ChangePasswordPage";
    public const string ViewAdminsPage = "ViewAdminsPage";
    public const string AdminVendorApprovalPage = "AdminVendorApprovalPage";
    public const string WebViewPage = "WebViewPage";
    public const string WebViewPageIOS = "WebViewPageIOS";


    public MainViewModel Main
    {
        get
        {
            return ServiceLocator.Current.GetInstance<MainViewModel>();
        }
    }

MainViewModel.cs

public class MainViewModel : ViewModelBase
{

  ..............................
    string loginRole = RoleEnumClass.Vendor.ToString();
    // RegisterParser RegParser = new RegisterParser();
    private MD5HashHelper md5helper = new MD5HashHelper();
    private INavigationServices _navigation;
    private GlobalMethods globalMethods = new GlobalMethods();
    private StoredUserDetailsModel user = new StoredUserDetailsModel();


    **public MainViewModel(INavigationServices navigation)**
    {
        _navigation = navigation;
        setPageData();

        MessagingCenter.Subscribe<EventArgs>(this, "onUsernameUnFocus", onUsernameUnFocus);

        App.getAppSettingsData();


    }

Application is working in debug mode but not in release mode. I am trying since two days please help me.

Xamarin forms Light Theme navigation bar background color

$
0
0

I am using Light Theme and it changes my navigation bar background color. Normally It is supossed to be taken from

PrimaryColor defined in my Style.xml and color xml

@color/primary
#2196F3

But instead of this color, I am getting some light blue color. I think everybody who uses Light Theme gets this color. How can I override this color? how do I even access this color. I want to know what RGB this color has? I cant find any source code for light theme. is it a top secret by xamarin? why dont they even make it ope source?

Can any one tell me how can i put two icon in Action bar?

$
0
0

I'm new in Xamarin so please help me...

Viewing all 204402 articles
Browse latest View live


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