Custom Toggle Button using c# code in xamarin forms - c#

I need to create custom toggle button using C# code. Please refer below snap, it should act like a toggle button.

If you don't want to use the plugin, you need to perform custom rendering.
https://github.com/chrispellett/Xamarin-Forms-SegmentedControl
The above github repository has the source code for custom rendering for segmented button in andorid and ios only not for windows.

Take a look at SegmentedButtonGroup in FreshEssentials. It looks like that is what you need.
http://www.michaelridland.com/xamarin/freshessentials-for-xamarin-forms-the-must-have-nuget-for-forms/

Related

How to use a PIP mode in Xamarin.forms?

Tap the video player to drop in to Picture-in-Picture mode. Tapping on the PiP view will present controls which can be used to pause, show info, return to full screen, or exit the application.
Xamarin.Forms by default only contains Views that work on all platforms. For example an Entry -> EditText (android), UITextField (iOS), TextBox (UWP).
The Picture-in-picture ability is something that's only available on Android, which means Xamarin.Forms did not implement this.
The only way i could think of doing this is by exporting custom renderers that set the native control for a home-made xamarin.forums-view. I think you can find a good example here: http://blog.infernored.com/going-native-using-android-views-in-xamarin-forms, though i haven't tried it myself.
You'd basically use the SetNativeControl command in the OnElementChanged hook of the custom renderer to probably dom.xamarin.PictureInPicture.MovieView. Don't forget to export the renderers on the namespace.
Then you can use the XF view on your xaml-pages. I'll look in to making an sample.
Picture-in-picture sample for android-only: https://developer.xamarin.com/samples/monodroid/android-o/PictureInPicture/

Custom Control in Xamarin.Forms from scratch

I would like to write a custom control which will look like this one using Xamarin.Forms. I know that when we want to modify the existing control from Xamarin.Forms we are using Custom Renderers, but this control is something more than Entry and the solution is not obvious to me.
My question is how do I start working on this task? What control should I extend if I would like to use custom renderer? Is there some other more effective way to achieve this?
Looks like the linked control is extending a UIPickerView.
You have two options
Create the binding for https://github.com/nicklockwood/CountryPicker
Create your own Xamarin.Forms control, which is basically a custom renderer. You can refer the Forms source code to create the controls for it.
You should create a pure Xamarin.Forms view class and renderers (inherited from ViewRenderer) for each platform.
Please have a look at XLabs projects - it should be a good point to start:
Cross-platfrom view: Separator.cs.
Android renderer: SeparatorRenderer.cs.

Custom popup for windows phone 8-1

I am working with windows phone 8-1[RT] application, I want to create custom popup like iOS I search lot in net but not found anything for that . Is there any other way to create custom popup which is used in entire application?
Another think I want to give popup to TOP-DOWN animation.
if you create a storyboard in blend ?? Add your xaml one container control and put inside everything you want (loading , text etc) and add your storyboard on your control . I don't know if you can create one similar with IOS but you can try .

How to create a custom button for Windows Store app?

I want to make a custom button in shape of a picture with C# for a Windows Store App?
Is there a way to do that from xaml? So far I've made a button and assigned a circle as a background image, but the problem is that even if I click outside the image the button works.
Also I do not believe that Image class has an event for click unfortunately.
I just recently implemented the WinRT XAML toolkit and it works wonder for me. It has an imagebutton control that might do what you want to do. http://winrtxamltoolkit.codeplex.com/
With the help of google: Walkthrough: Create a Button by Using XAML
You should have a look into Expression Blend. You can do all manualy in the XAML-Code but Blend is a huge help if you like to customize your project look and feel. Look at the MSDN-Examples.

Need suggestion on Silverlight application

I am a beginner in silver light. I created a test application, in which on top there are menus like Home, About Us etc?? and there is a grid control to show content related to menu.
I created controls for Home, About Us etc, and I add this control on a click of associated menu. but I am looking for some generic way, rather than handling click of each menu separately, I also created a common click event, but the problem how can I get the Home COntrol or a About Us Control to add in a grid. In click event method I can get the clicked menu Information. I can write switch statement but it will also not called as a generic.
Something Like find a particular page/Control by its name in a whole silverlight application and add it to my grid.
Thanx!
Take a look at Ria Services and MEF. I'm currently on a Silverlight project and we are relying heavily on Ria Services and MEF. We are using a VMMV approach. It's working out nicely.
Silverlight has the Frame and Page controls to help you with some of these issues.
Check out:
http://msdn.microsoft.com/en-us/library/cc838245%28v=vs.95%29.aspx
This could be solved by using silverlight navigation, have a look at this blog and here
you can then do something like:
this.MainFrame.Navigate(new Uri("Page2.Xaml",UriKind.Relative));
// where page 2 is your page name taken from your menu item

Categories