Hi Guys,
This blog post can help you about making your own generic picker page so easier.
http://www.xamaring.com/en/making-a-simple-picker-page-using-messagingcenter-and-listview/
Hi Guys,
This blog post can help you about making your own generic picker page so easier.
http://www.xamaring.com/en/making-a-simple-picker-page-using-messagingcenter-and-listview/
I tried to use the code found here :
https://developer.xamarin.com/api/type/Xamarin.Forms.OpenGLView/
using Xamarin.Forms;
using OpenTK.Graphics.ES30;
But When Debug starts, a Window opens (image attached) :
"Find Source"
And looks for the following file :
UncaughtExceptionHandler.cs
here :
/Users/builder/data/lanes/3053/a94a03b5/source/monodroid/src/Mono.Android/src/Runtime/UncaughtExceptionHandler.cs
When cancelled, the following error appears :
"Unhandled Exception:
Java.Lang.IllegalArgumentException: No configs match configSpec"
I guess my java or Android sdk or opentk.dll configuration is not ok.
I tried both using OpenTK.Graphics.ES20 and ES30.
Does anybody know a solution ?
I wrote this starter demo based on Xamarin triangle ES20 demo. I hope that will help people to use OpenGlView.
<StackLayout Spacing="0" BackgroundColor="Black" >
<Label TextColor="White" Text="test" ></Label>
</StackLayout>
<StackLayout BackgroundColor="Blue" Spacing="0">
<Label TextColor="Black" Text="test1" ></Label>
</StackLayout>
Hi - i've seen this discussed a lot with Android, and with plenty of examples it was an easy fix. The ScrollView has a child with a custom renderer, in which i capture Touch events, like a joystick pad.
In Android i use this.Parent.RequestDisallowInterceptTouchEvent(true) successfully, as such...
void progress_Touch(object sender, Android.Views.View.TouchEventArgs e) {
switch (e.Event.Action) {
case MotionEventActions.Down:
this.Parent.RequestDisallowInterceptTouchEvent(true);
Element.BindableTouchDown((int)e.Event.GetX(), (int)e.Event.GetY());
break;
case MotionEventActions.Move:
Element.BindableTouchMove((int)e.Event.GetX(), (int)e.Event.GetY());
break;
case MotionEventActions.Up:
case MotionEventActions.Cancel:
Element.BindableTouchUp((int)e.Event.GetX(), (int)e.Event.GetY());
this.Parent.RequestDisallowInterceptTouchEvent(false);
break;
}
}
However, in iOS i tried a bunch of different things without success. Such as...
void setParentTouches(bool enabled) {
UIView t = this.Superview;
while (t != null) {
if (t.GetType() == typeof(ScrollViewRenderer))
t.UserInteractionEnabled = enabled;
t = t.Superview;
}
}
public override void TouchesBegan(Foundation.NSSet touches, UIEvent evt) {
setParentTouches(false);
var touch = touches.AnyObject as UITouch;
Element.BindableTouchDown((int)touch.LocationInView(this).X, (int)touch.LocationInView(this).Y);
base.TouchesBegan(touches, evt);
}
public override void TouchesMoved(Foundation.NSSet touches, UIKit.UIEvent evt) {
var touch = touches.AnyObject as UITouch;
Element.BindableTouchMove((int)touch.LocationInView(this).X, (int)touch.LocationInView(this).Y);
base.TouchesMoved(touches, evt);
}
public override void TouchesEnded(Foundation.NSSet touches, UIKit.UIEvent evt) {
setParentTouches(true);
var touch = touches.AnyObject as UITouch;
Element.BindableTouchUp((int)touch.LocationInView(this).X, (int)touch.LocationInView(this).Y);
base.TouchesEnded(touches, evt);
}
public override void TouchesCancelled(Foundation.NSSet touches, UIEvent evt) {
setParentTouches(true);
var touch = touches.AnyObject as UITouch;
Element.BindableTouchUp((int)touch.LocationInView(this).X, (int)touch.LocationInView(this).Y);
base.TouchesCancelled(touches, evt);
}
Hello,
I want a method to know if the phone is connected to the internet.
I try with NetworkInterface.GetIsNetworkAvailable()
but it does not work
Thank you for your help. Loïc
Hi, I was wondering how to center things in a StackLayout. I can set the orientation to StackOrientation.Vertical and set the VerticalOptions to LayoutOptions.Center, but the items are only centered horizontally at the top of the screen. How do I have a stack that expands starting in the middle of the device's screen, so that I don't have to hard-code numbers for the padding?
for example:
{Binding Path=PathToProperty, RelativeSource={RelativeSource AncestorType={x:Type typeOfAncestor}}}
Hello guys,
I need to get ID of Android and WP device. I have no problem with Android, but there is one with WP. I try to use this method:
byte[] myDeviceId = (byte[])Microsoft.Phone.Info.DeviceExtendedProperties.GetValue("DeviceUniqueId");
but VisualStudio says to me that there is no valid improt for Microsoft class and also I can't find any. Is it removed now?
<ListView x:Name="List">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid>
<StackLayout>
<Label Text="{Binding Quantity}" />
</StackLayout>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
List.ItemTapped+= (sender, e) =>
{
var item = (item)e.SelectedItem;
item.Quantity +=1;
};
}
Hi all.... I need to developer a notification push for test same apps (IOS, Android and WP8.1). It's my first push and I've asks a lot.
Can I dev a push notification without a Service of Azure notification hub?
Someone knows other company have the similar service?
Ps.. the Azure canceled my free account.
tks
Hi ,
I tried to set the transparent background color of the navigation bar using below code snippet, But I can't able to proceed this.
For more info please find the snap
Hi guys,
someone use mvvm light by Laurent Bugnion? I have a problem with navigationservice..
I have found this code:
https://mallibone.com/post/xamarin.forms-navigation-with-mvvm-light
https://github.com/mallibone/MvvmLightNavigation.XamarinForms
but it doesn't work, the problem is when in App.cs set the MainPage, Runtime return System.Exception: Android only allows one navigation page on screen at a time.
However someone know the best way or a package to implement NavigationService in Xamarin.Forms with MasterDetailPage?
Thank u!!!
DS
Hi,
i noticed detailpage is loaded from scratch everytime masterpage menu item is selected (so its constructor is called everytime).
Is there a way to implement a detailpage which is loaded once, so everytime menu item is selected detailpage is simply showed/not showed?
Thanks,
Lewix
I believe the offer.EndTime line is causing the problem.
offer.StartDate = DateTime.Now.Date;
offer.StartTime = DateTime.Now.TimeOfDay;
offer.EndDate = DateTime.Now.Date;
offer.EndTime = DateTime.Now.TimeOfDay.Add(TimeSpan.FromHours(2));
If I create an offer after 10pm, I get the following error in the OnBindingContentChanged method.
System.ArgumentException: Value was an invalid value for Time
Parameter name: value
Here is the DateSelected methods.
startDatePicker.DateSelected+=((o2,e2)=>
{
this.startDateSelectedLabel.Text = "true";
vm.CurrentOffer.StartDateSelected = "true";
});
endDatePicker.DateSelected+=((o2,e2)=>
{
this.endDateSelectedLabel.Text = "true";
vm.CurrentOffer.EndDateSelected = "true";
});
Is this a bug or is there a way I can handle this?
Any help is much appreciated. Thanks!
Hi guys.
Would it be possible to hide the suggestions in the Android keyboard?
I do not like it because takes too much space.
Thanks in advance mates
We are using Xamarin Forms 2.1.0.6529 to develop an app for iOS, Droid and UWP.
In one page, we have a ListView whose cells are ViewCells. Individual cells can be selected, but multiple selection is also possible. To support multiple selection, each view cell has a selection indicator, a label with a Tap Gesture Recognizer, which shows a check mark if the label is tapped. To confirm multiple selection, a button is used which navigates to another page when clicked. For individual cell selection, we use the SelectedItem property and when selected we navigate to another page.
This works fine on iOS and Droid, i.e. when tapping on the selection indicator label, the SelectedItem property is NOT set.
However, on Windows UWP, both the SelectedItem is set and the tap gesture is fired. Since the SelectedItem is set, we immediately navigate to another page, which is not intended. What is even worse, is that first the SelectedItem property is set and then the tap gesture is fired. This means that we cannot even only navigate if the selection indicator has not been set.
Is this a Xamarin bug, since Windows UWP behaves differently to iOS and Droid?
Any ideas for workaround?
.. when defined in xaml:
<ContentPage.ToolbarItems>
Hi, I have a question about FreshMvvm navigation:
How do I put a TabbedPage in Detail of MasterDetailPage using FreshMvvm?
I can't figure out how to do that with AddPage() that takes a FreshMvvmPageModel as a parameter.
I made a PageModel to the TabbedPage but it gives me error when lauching
Thanks in advance
I following code is an example from a larger codebase that should have enough context for my issue. In my code I'm calling AppendText many times in a row. I would expect the ScrollingStackCount after all 3 calls to = 0 (after the last ScrollingStackCount--) but sometimes it may be 1 or even 2. I'm assuming it has something to do w/how I'm doing the await but do not understand. Thanks, -jv
private int ScrollingStackCount=0;
void Test()
{
AppendText("text");
AppendText("text");
AppendText("text");
}
async void AppendText( string formattedText )
{
this.Children.Add( new Label() { Text=formattedText } );
ScrollingStackCount++;
await parentScroll.ScrollToAsync(this, ScrollToPosition.End, !string.IsNullOrEmpty(formattedText));
ScrollingStackCount--;
}