Recent articles


How to open a New View on Button Click in Xamarin Forms?

Posted by seven.srikanth@gmail.com at 30 Nov 2017 in Tutorials


You need to use the below code for opening the new view. 
 Step 1: Add this code to the Main View or to the view where you need to place a button.
 
<Button x:Name="Btn_Book" Text="Proceed" Clicked="Btn_Book_Clicked" />
Step 2: Add this code to the page behind.
 
        async void Btn_Book_Clicked(object sender, EventArgs e)
        {
            await Navigation.PushModalAsync(new anotherview());
        }
On Button click, anotherview.xaml will be opened. 
Hope this helps.

Tags: Button Click in Xamarin Forms




Picker in Xamarin Forms

Posted by seven.srikanth@gmail.com at 30 Nov 2017 in Tutorials


You can add the below code to your xamarin forms project to add a picker to your UI.
Steps:
1. Add this code to Xaml file.
 
<Picker x:Name="numberpicker" Title="Number of Cans" />
2. Add the below code to Init Method.
 
var numberslist = new List();
 
for (int i = 0; i < 100; i++)
{
       numberslist.Add(i);
}

numberpicker.ItemsSource = numberslist;
3. Run the Program.
Screenshot of Picker:
Thanks.

Tags: Picker; Xamarin Forms;




System.IO.PathTooLongException: The specified path, file name, or both are too long.

Posted by seven.srikanth@gmail.com at 30 Nov 2017 in Errors


Got error when I run a freshly created a Xamarin Cross Platforms app.
Full Error:
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
This issue occurred because the path of the application you created is having so many folders and exceeds 260.
So I just moved that to a different and shorter path, which has resolved my issue.
Old Path: C:\Users\Srikanth\Documents\Visual Studio 2017\Projects\WaterBookingApp
New Path: C:\Temp\WaterBookingApp
Hope this helps.

Tags: System.IO.PathTooLongException