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

Is it normal for Visual Studio to get really slow when working with Xamarin.Forms?

$
0
0

I've noticed that when working with Xamarin.Forms projects Visual Studio get's really slow, specially when editing XAML files. When I'm working with XAML there's a huge delay when I'm typing, sometimes Visual Studio freezes, and Intellisense doesn't work most of the time. That only happens when editing XAML with Xamarin projects, when I try XAML + WPF it works great. My projects are also really small, since I'm just now learning Xamarin, and I don't have any addon (like ReSharper) installed. My laptop isn't super fast, but it has a i5 processor with 4GB and an SSD, it's was enough until I started working with Xamarin. Any ideas?

PS: I'm using Visual Studio 2015 Enterprise with Update 2.


Xamarin.Forms.CarouselView

$
0
0

Hi Xamarin, When can we expect Xamarin.Forms.CarouselView stable version with a sample?

How to translate local images resource to bitmap?

$
0
0

Hi,
Er, recently I have a problem about xamarin.forms.I think it's a quiet simple,but I can't reslove it.
I learned how to create a customer control based on ViewBox.I want to give the control based on ViewBox a backgruondImage.I add a image named 'viewbox_bg.png' to the Droid.My problem is xamarin.forms how to read the image named 'viewbox_bg.png' as a bitmap so I can draw the picture by using canvas with the function named DrawBitmap ?
Any suggestion or exmaple code is helpful. thx everybody.
Click the icon if the images are not show.
image

image

Popup Page Plugin for Xamarin Forms for windows

$
0
0

Popup Page Plugin for Xamarin Forms

Plugin for Xamarin forms. Allows you to open any page as a popup. It support only Android and iOS.
What about Windows Phone?

How to left align a button in Xamarin forms ?

$
0
0

I've a button in xamarin forms. I want it to left align on my device. On iOS it is by default left aligned but for android it is center aligned. I tried using custom renderer for button and set it gravity to left as shown in code below but it does not work for me. Below is my code snippet of button and it's custom renderer. I've added this CustomButton in horizontal stack layout. So, my question is how to left align a button on android ?

`
public class CustomButton : Button
{
public CustomButton ()
{
}
}

var editButton = new CustomButton () {
TextColor = Color.Gray,
Text = Constants.mStringEdit,
BackgroundColor = Color.Green,
FontSize = 18,
HorizontalOptions = LayoutOptions.Start,
};

public class CustomButtonRenderer : ButtonRenderer
{
public CustomButtonRenderer ()
{
}

    protected override void OnElementChanged (ElementChangedEventArgs<Button> e)
    {
        base.OnElementChanged (e);

        Android.Widget.Button button = Control as Android.Widget.Button;

        if (button != null) {
                button.Gravity = GravityFlags.Left;
        }
    }
}

`

Xamarin Forms iOS Navigation stack error

$
0
0

Xamarin.Forms.Platform.iOS.NavigationRenderer.GetAppearedOrDisappearedTask NullReferenceExceptionObject

https://bugzilla.xamarin.com/show_bug.cgi?id=38731

This has been reported by many developers perviously.
After that Xamarin has fixed it.

But,
This is happening again in Xamarin Forms 2.2.0.45
Tested environment iOS 9.3

Xamarin Team,
Please fix this asap.

at Xamarin.Forms.Platform.iOS.NavigationRenderer.GetAppearedOrDisappearedTask (Xamarin.Forms.Page page) [0x00018] in :0
at Xamarin.Forms.Platform.iOS.NavigationRenderer.RemoveViewControllers (Boolean animated) [0x00055] in :0
at Xamarin.Forms.Platform.iOS.NavigationRenderer.PopViewController (Boolean animated) [0x00000] in :0
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:77
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3234/d8bedd03/source/maccore/src/UIKit/UIApplication.cs:61
at Brusselslife.iOS.Application.Main (System.String[] args) [0x00008] in /Users/hiranpeiris/Documents/Xamarin/brusselslife_mobile/iOS/Main.cs:17

Device.StartTimer does not invoke callback method.

$
0
0

Hey Guys,

I am developing a cross platform poker app using xamarin and PCL. I'm using Profile78 for PCL. I want to write down some logic in PCL so that it can fetch data from server after every 5 seconds and show it on device screen. I'm trying to achieve this by using Device.Timer class. The challenge I'm facing is, when the timer lapses after 5 seconds it doesn't invoke the callback method. Here is the code snippet.

int KeepAliveTimer = 5000;
Device.StartTimer(new TimeSpan(0, 0, 0, 0, KeepAliveTimer), () =>
{
TimeSpan differ = receiveKeepAliveDate.Subtract(sendKeepAliveDate);
KeepAliveTimer = Convert.ToInt32(differ.TotalMilliseconds) + 5000;
if (KeepAliveTimer < 5000)
{
KeepAliveTimer = 5000;
}
OnKeepAliveTimer();
return true;
});

I also tried with rather a simpler version but that also seems not working.

Device.StartTimer(new TimeSpan(0, 0, 0, 5, 0), TimerCallBack);

private bool TimerCallBack()
{
OnKeepAliveTimer();
return true;
}

Could you guys please help me out in getting why the callback method is not invoking. I tried every possible solution I found on Google but nothing seems working here.

Could not install package 'XLabs.Forms.Charting 2.0.5781'. xamarin forms

$
0
0

Severity CodeDescription Project File Line Suppression State
Error Could not install package 'XLabs.Forms.Charting 2.0.5781'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111',
but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the >package author. 0

This is the error comes when i try to add 'XLabs.Forms.Charting nuget in my xamarin form project anyone got solution for this ?

thanks in advance


How to switch the tabs

$
0
0

Hi,

While switching the tabs i used the below code but it is not redirected. may i know how to switch the tabs?

public void SwitchToTab1() {
CurrentPage = tab1Page;
}

How do overlap in Xamarin forms?

$
0
0

Does the concept of z-index? The picture shows that there is no overlap. enter image description here How to set z-index? the top two custom select box

<AbsoluteLayout Padding="10,10,10,10" VerticalOptions="FillAndExpand">

    <ui:BoxSelector x:Name="selectorExchangs"
                    AbsoluteLayout.LayoutBounds="0,0,0.5,0.3"
                    AbsoluteLayout.LayoutFlags="All"
                    BackgroundColor="Transparent"
                    CommandAfterChanged="{Binding ExchangesAfterChangedCommand}"
                    Items="{Binding ExchangesList}"
                    LabelPath="Name"
                    PanelColor="#f9f9f9"
                    SelectedItem="{Binding SelectedExchange}"
                    SelectorLabel="EXCHANGE" />

    <ui:BoxSelector AbsoluteLayout.LayoutBounds="1,0,0.5,0.3"
                    AbsoluteLayout.LayoutFlags="All"
                    BackgroundColor="Transparent"
                    CommandAfterChanged="{Binding TradingPairAfterChangedCommand}"
                    Items="{Binding AvailableTradinPairsList}"
                    LabelPath="PriceCurrencyName"
                    PanelColor="#f9f9f9"
                    SelectedItem="{Binding SelectedTraingPair}"
                    SelectorLabel="CURRENCY" />

And all the rest. Chart, data, e.t.c

`<StackLayout AbsoluteLayout.LayoutBounds="1,1,1,0.9" AbsoluteLayout.LayoutFlags="All">...</StackLayout>`

BoxSelector.xaml(content view), Reusable ContentView extends

<ContentView.Resources>
    <ResourceDictionary x:Name="AppDictionary">
        <Color x:Key="BackgroundColor">#f9f9f9</Color>
        <Color x:Key="BorderColor">#e2e2e2</Color>
        <Style x:Key="InternalViewStyle" TargetType="ContentView">
            <Setter Property="BackgroundColor" Value="{StaticResource BackgroundColor}" />
            <Setter Property="VerticalOptions" Value="Fill" />
            <Setter Property="Padding" Value="5,5,5,5" />
        </Style>
        <Style x:Key="BorderStyle" TargetType="ContentView">
            <Setter Property="BackgroundColor" Value="{StaticResource BorderColor}" />
            <Setter Property="Padding" Value="1,1,1,1" />
        </Style>
    </ResourceDictionary>
</ContentView.Resources>

<StackLayout BindingContext="{x:Reference Name=ContentView}" HorizontalOptions="FillAndExpand">
    <ContentView BackgroundColor="#f5f5f5" HorizontalOptions="FillAndExpand">
        <StackLayout>
            <ContentView Style="{StaticResource BorderStyle}">
                <ContentView Style="{StaticResource InternalViewStyle}">
                    <StackLayout Orientation="Horizontal">
                        <StackLayout x:Name="selectorBox"
                                     BackgroundColor="{Binding PanelColor}"
                                     HorizontalOptions="FillAndExpand"
                                     Orientation="Horizontal">
                            <StackLayout HorizontalOptions="StartAndExpand" Orientation="Horizontal">
                                <Label FontSize="12"
                                       HorizontalOptions="FillAndExpand"
                                       Text="{Binding SelectorLabel}"
                                       TextColor="#cccccc" />
                                <Label x:Name="valueLabe"
                                       BackgroundColor="{Binding PanelColor}"
                                       FontSize="13"
                                       HorizontalOptions="FillAndExpand"
                                       Text="Choose"
                                       TextColor="#313131" />
                            </StackLayout>
                            <StackLayout HorizontalOptions="EndAndExpand">
                                <Label Text="+" TextColor="#313131" />
                            </StackLayout>
                        </StackLayout>
                    </StackLayout>
                </ContentView>
            </ContentView>

            <Grid x:Name="boxSelectorGrid"
                  BackgroundColor="#f5f5f5"
                  Padding="10,10,10,10">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
            </Grid>

        </StackLayout>
    </ContentView>
</StackLayout>

Is xamarin SAP sdk component available for windows phone 8.1

$
0
0

Is xamarin SAP sdk component available for windows phone 8.1

RelativeLayout Background Gradient Effect

$
0
0

Hi there,

Someone knows how to add a gradient background Color for RelativeLayout?

TIA

ex: gradient effect (Color.Red and Color.Blue)

What happened to the CarouselView?

$
0
0

I was really looking forward to trying this out and now it doesn't seem to exist anywhere at all. Anyone know what happened?

Application.Properties NOT saved on release version.Debug Version is ok!

$
0
0

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Xamarin.Forms;

namespace App4
{
internal class LoginPage : ContentPage
{
public IDictionary<string, object> Properties;
Switch autoLogin;
public LoginPage(IDictionary<string, object> p)
{
// BindingContext = ViewModel;
Properties = p;
object t;
bool b = Properties.TryGetValue("AUTO", out t);
autoLogin = new Switch
{
HorizontalOptions = LayoutOptions.Center,
};
if(b)
autoLogin.IsToggled = (bool)t;
autoLogin.Toggled += AutoLogin_Toggled;
Content = autoLogin;
}

    private void AutoLogin_Toggled(object sender, ToggledEventArgs e)
    {
        Properties["AUTO"] = true;
    }
}

public class App : Application
{
    public App()
    {
        // The root page of your application
        MainPage = new LoginPage(this.Properties);
    }

    protected override void OnStart()
    {
        // Handle when your app starts
    }

    protected override void OnSleep()
    {
        // Handle when your app sleeps
    }

    protected override void OnResume()
    {
        // Handle when your app resumes
    }
}

}

x:Name="itemName"

$
0
0

I have found this code on a label control: x:Name="itemName"
What is this code, and what use has the code x:Name="itemName"

Regards Thore


Conditional Binding

$
0
0

I have a listview and inside that I have an Image, What I want is to load an Image as for the binding value
Data in Binding List
int ID,
bool isProcessed

so if isProcessed is true I want to load processed image else will load unprocessed image to the image source.

Why this appears every time an app is run in iOS 9.3 simulator?

$
0
0

I am seeing this only after recent update to Xcode. I am clicking 'Allow' every time. How can I avoid this message?

@AdamP this is what I was talking about in another thread that you answered.

Android Menu and Back Button not working

$
0
0

Hi

I have an Xamarin.Forms project targeting Android, iOS and UWP.
In my Android-App, the hardware backbuttons of my phone are not working (back button and also the menu button).

Why is that? Did I forgot something?

Thanks

How to handle the event of Done button click from PCL

Build XF project on Mac using script

$
0
0

How to initiate a build and compile action on a Mac machine for a Xamarin Forms solution? I want to write a script to do my build action as part of build automation.

I know we could initiate build for .net projects on windows machine using msbuild. What is the equivalent in Mac OS.

Viewing all 58056 articles
Browse latest View live


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