i am using Messier16.Forms.Checkbox library for Checkbox Control in Xamarin Windows App. it does not have Selected event.
Kindly suggest any library in xamarin UWP project for Checkbox control which contains Selected Event.
Thanks in Advance
Reddy Krishna
From the sample source of Messier16.Forms.Controls.Checkbox:
checkbox.PropertyChanged += (sender, e) =>
{
if (e.PropertyName.Equals("Checked"))
{
cb2.IsEnabled = checkbox.Checked;
cb3.Checked = !checkbox.Checked;
}
};
Re: https://github.com/messier16/Forms.Controls/blob/master/Sample/SampleLocalApp/SampleLocalApp/Pages/CheckboxPages/CheckboxCodePage.cs#L31
Related
I created a xamarin forms project which is using oxyplot and Rg.Plugins.Popup xamarin forms.
However, the graph does not work as excepted. I modified code refer to the link, but graph not show on UWP .
In addition, I init Rg.Plugins.Popup and oxyplot with follow code, I don't know what I doing wrong. Please help. thanks in advance.
in UWP project App.xaml.cs
Xamarin.Forms.Forms.Init(e, Rg.Plugins.Popup.Popup.GetExtraAssemblies());
List<Assembly> assembliesToInclude = new List<Assembly>();
//Now, add in all the assemblies your app uses
assembliesToInclude.Add(typeof(OxyPlot.PlotModel).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.PlotController).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Windows.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer).GetTypeInfo().Assembly);
try
{
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
// replaces Xamarin.Forms.Forms.Init(e);
}
catch (Exception ex) { }
OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init();
Xamarin forms and oxyplot version is
OxyPlot.Xamarin.Forms : 1.1.0-unstable0011
Xamarin.Forms: 4.2.0.709249
If you want to use both of them, you could insert their assemblie in the same list. For more please refer the following.
List<Assembly> assembliesToInclude = new List<Assembly>();
Popup.Init();
OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer.Init();
assembliesToInclude.Add(typeof(OxyPlot.PlotModel).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.PlotController).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Windows.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.PlotView).GetTypeInfo().Assembly);
assembliesToInclude.Add(typeof(OxyPlot.Xamarin.Forms.Platform.UWP.PlotViewRenderer).GetTypeInfo().Assembly);
var assemblies = Popup.GetExtraAssemblies();
assembliesToInclude.AddRange(assemblies);
var count = assembliesToInclude.Count;
try
{
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
}
catch (Exception ex) {
}
I try to have Infinite Scroll in Xamarin Syncfusion component SFCarousel.
I try many solution of mine but don't work.
Have you any advise?
I try this code for example:
void Handle_SelectionChanged(object sender, Syncfusion.SfCarousel.XForms.SelectionChangedEventArgs {
if (carousel.SelectedIndex == viewModel.ImageCollection.Count - 1)
{
CarouselModel item = viewModel.ImageCollection.First();
viewModel.ImageCollection.Remove(item);
viewModel.ImageCollection.Add(item);
}
if (carousel.SelectedIndex == 1)
{
CarouselModel item = viewModel.ImageCollection.Last();
viewModel.ImageCollection.Remove(item);
viewModel.ImageCollection.Insert(0, item);
}
}
Xamarin Syncfusion component SFCarousel has perspective view. It doesn't have support for infinite scroll,but this can be achieved by using the SfRotator Control.
http://www.syncfusion.com/downloads/support/forum/139915/ze/Rotator_Sample-1424193758
Note: I'm working for Syncfusion
I have made an iOS customrenderer for a Button in my PCL.
The button is a custom button, Hence why my PCL Handle_clicked event doesn't fire.
I suppose i need to add something in:
btn.TouchUpInside += (object sender, EventArgs c) =>
{
};
in order to make some sort of callback, so that my Handle_clicked event knows when the user has clicked the button. I just don't know how, as customrenderers are fairly new to me.
I have tried adding the following to my custom button:
UIButton btn = new UIButton(UIButtonType.Custom);
btn = Control as UIButton; //I have added this
Unfortunately by doing so, it recognize the click event, but doesn't add my custom styling.
we were using the Notifier Plugin in our application to show the Notification for our Xamarin Forms application.
Notifier Plugin URL: https://github.com/edsnider/Xamarin.Plugins/tree/master/Notifier
For customizing the Notification Navigation with Android Platform,
Changes made in Plugin.LocalNotifications.Android Source as :
In LocalNotificationsImplementation as "var resultIntent = new Intent(Application.Context,typeof(RedirectActivity));"
In RedirectActivity Activity, we have included "MessagingCenter.Send("SampleAppNotificationNavigation", "RedirectToNavigationPage");"
Changes made in MyApplication.Android Source as :
In our Android application we subscribed messaging center as " MessagingCenter.Subscribe(this, "RedirectToNavigationPage", message =>
{
LoadApplication(new NextPage());
});"
Note: Based on the suggestion from Native to Forms Page Navigation we have implmented the same.
https://github.com/xamarin/xamarin-forms-samples/tree/master/Native2Forms
In our core project App page we have included as "
public class NextPage : Application
{
public NextPage()
{
MainPage = new NavigationPage(new ConfigureServer());
}
}"
Everything is working as expected (till ConfigureServer page constructor and intializecomponent() riased ) but failed to launch the ConfigureServer Page.
Kindly guide us to proceed further.
Thanks in advance.
I have been trying to run Test Recorder against Android and iOS apps created with Xamarin Forms. When I click on a control in Test Recorder I do not see an Id placed in the C# file generated, just the class type.
I decided to remove Test Recorder from the equation and try and get basic UI Tests running against a Xamarin Forms Android app.
I downloaded a demo app from here:
https://developer.xamarin.com/samples/xamarin-forms/UsingUITest/
It should have everything in place to work correctly against UITest including StyleIds and code in the MainActivity to map the StyleIds to ContentDescriptions.
I ran tree in the REPL terminal session to inspect the screen hierarchy and it appears to show no ids for the controls that should have them.
>>> tree
[[object CalabashRootView] > PhoneWindow$DecorView]
[ActionBarOverlayLayout] id: "decor_content_parent"
[FrameLayout > ... > Platform_DefaultRenderer] id: "content"
[ButtonRenderer]
[Button] label: "MyButton", text: "Click me"
[LabelRenderer]
[FormsTextView] label: "MyLabel", text: "Hello, Xamarin.Forms!"
[View] id: "navigationBarBackground"
[View] id: "statusBarBackground"
>>>
Any ideas?
In Xamarin Forms the StyleId is just essentially a placeholder that you use to transfer over to the native counter part.
For Android make sure you have this in MainActivity.cs
Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) => {
if (!string.IsNullOrWhiteSpace(e.View.StyleId))
{
e.NativeView.ContentDescription = e.View.StyleId;
}
};
In iOS do this
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {
if (null != e.View.StyleId)
{
e.NativeView.AccessibilityIdentifier = e.View.StyleId;
}
};
LoadApplication(new App());
#if ENABLE_TEST_CLOUD
// requires Xamarin Test Cloud Agent
Xamarin.Calabash.Start();
#endif
return base.FinishedLaunching(app, options);
}
Then you should start seeing your Ids come through for your Xamarin Forms Elements.