Hi,
i have to list out all the timezones like (UTC-12:00) International Date Line West......in PCL.
i can able to do with TimeZoneInfo.GetSystemTimeZones(). but this not displays UTC with name ... please help me to do this..
Hi,
i have to list out all the timezones like (UTC-12:00) International Date Line West......in PCL.
i can able to do with TimeZoneInfo.GetSystemTimeZones(). but this not displays UTC with name ... please help me to do this..
I'm trying to use a view-to-view binding using x:Reference, but am having no luck. Specifically, I am binding the command/parameter of a TextCell's context actions menu. I wish to bind the command itself to an ICommand property of the main view model, while keeping the command parameter bound to the current item of the ListView that contains the cells. So this means using x:Reference as the Source of the command binding. Yet this doesn't seem to work.
I tried digging through the Xamarin Forms code using dotPeek to see if I could figure out what was going wrong - and I don't even see a ReferenceExtension class in XF 1.3 (Stable)?? Was this removed from the platform, or am I just looking in the wrong place?
My code looks very similar to this, however the binding's Source is totally being ignored:
<ListView ItemsSource="{Binding EventsList}"
x:Name="EventsList">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Name}">
<TextCell.ContextActions>
<MenuItem Text="Delete"
IsDestructive="True"
Command="{Binding Path=BindingContext.DeleteEventCommand, Source={x:Reference Name=EventsList}}"
CommandParameter="{Binding}"/>
</TextCell.ContextActions>
</TextCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
The ListView's BindingContext is a viewmodel class that has an ObservableCollection of items named EventsList, as well as an ICommand named DeleteEventCommand.
Is there any way to implement Stripe card widget in the Xamarin.Forms? for Android and iOS
Something like this?
https://stripe.com/docs/mobile/ios
Good Day
i am a Loading Page functionality that is defined here https://github.com/UdaraAlwis/Xamarin-Playground/tree/master/XFLoadingPageService . The loading Diaolog only show if i use
await Task.Delay(2000);
my code looks like this
private async void btnstart_Clicked(object sender, EventArgs e)
{
DependencyService.Get<ILodingPageService>().InitLoadingPage(new LoadingIndicatorPage2());
DependencyService.Get<ILodingPageService>().ShowLoadingPage();
data .data obj = new data .data ();
try
{
lblstatus.Text = "Before the call";
// just to showcase a delay...
// await Task.Delay(2000);
var lstentities = await obj.FindPerson_Report_Basic("81248877");
lblstatus.Text = "After the call";
}
catch (Exception ex)
{
await DisplayAlert("Error:", ex.Message, "Ok");
}
finally
{
obj = null;
DependencyService.Get<ILodingPageService>().HideLoadingPage();
}
}
but the loading page does not load , as you can see i commented the Delay part.
Thanks
I need focus a entry after of click a button.
I has think in implement a Behavior but i dont know that is the problem.
This is my code.
View.
Behavior Class.
`public class EntryFocusBehavior : Behavior
{
public bool OnFocus { get; set; }
protected override void OnAttachedTo(Entry bindable)
{
base.OnAttachedTo(bindable);
bindable.TextChanged += OnEntryTextChanged;
}
protected override void OnDetachingFrom(Entry bindable)
{
base.OnDetachingFrom(bindable);
bindable.TextChanged -= OnEntryTextChanged;
}
void OnEntryTextChanged(object sender, TextChangedEventArgs e)
{
var entry = (Entry)sender;
if (OnFocus)
{
entry.Focus();
}
else
{
entry.Unfocus();
}
}
}`
And viewmodel.
public bool OnFocus { get; set; }
OnFocus ="True or False"
I need use PropertyChanged in view model binding??
Binding control is two away?
Thanks by help me forum community.
Hi
I am getting the below error while deploying..
The package does not support the device architecture (x86). You can change the supported architectures in the Android Build section of the Project Options.
Deployment failed. Architecture not supported.
It's nothing too elaborate, though I'm having a hard time replicating this in Xamarin Forms. As in, a view that the user can actually drag up and down.
Does Xamarin Forms have an easy solution for this problem? I've tried a bunch of libraries already and none of them seem to work/work with .Net Standard projects.
I'm currently using this solution, though it's far from perfect. Any ideas?
Just went to Xamarin.Forms 1.3.4.6328-pre2 and now get the error "The given key was not present in the dictionary." How can find in my xaml what may be causing the problem? I attached the xaml in a text file.
after login automatically I want to make a specific page as a root page.so how to do this in FreshMVVM Xamarin Forms?
Why itemSelected is not working. plz plz plz plz any suggestion.
How to open default contacts app in xamrin forms?
I was wondering if anyone else uses Rg.Plugins.Popup for their pop up modals in their app and use Android. The issue i'm experiencing happens with a modal that has several inputs in it with save and cancel buttons at the bottom. When tapping into a text editor input (keyboard opens up), then tapping outside on blank space it auto focuses on the next input. When hitting a button in the modal it auto focuses on the first input in the modal. Why this is an issue is because on Android if you focus on a drop down or date picker it opens its own modal for that input. If I click the save or cancel buttons the modal is no longer open meanwhile that input datepicker now opened up and will crash the app. Ill report this on Rg Popups page too, but was wondering if anyone else encountered this and if they have a work around.
Hi!
The interface of my application is divided into a header (it is a webview) and absolute content, which among other things contains a second webview.
In vertical orientation it works and looks perfect.
But when I turn the device horizontally the header stops measuring 70 and measures something like 30 ....
The header reduces the height although it has a fixed height.
Why this happen? Any solution?
Thanks!
`
<ContentPage.Content>
<WebView x:Name="webview_header" HorizontalOptions="FillAndExpand" HeightRequest="70" BackgroundColor="Red"/>
<AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="Black">
<!-- other things -->
<ScrollView AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" BackgroundColor="Green">
<AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="0" BackgroundColor="Purple">
<WebView x:Name="webview" AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All" BackgroundColor="Blue" />
</AbsoluteLayout>
</ScrollView>
</AbsoluteLayout>
</StackLayout>
</ContentPage.Content>
`
Here is my code to create a WebView and feed it with some html.
WebView wb = new WebView();
wb.VerticalOptions = LayoutOptions.FillAndExpand;
wb.HorizontalOptions = LayoutOptions.FillAndExpand;
HtmlWebViewSource s = new HtmlWebViewSource();
s.Html = ProcessHtmlJS(p.Content.Rendered); // GET Some html to display
wb.Source = s;
Navigation.PushAsync(new ContentPage { Content = wb });
Works perfectly on android.
I can't scroll within the webview on UWP.
If I set the source to some website online I can scroll and everything is ok.
The bug occurs when I Load some html with the HtmlWebViewSource on UWP.
Has anyone faced the same difficulty ?
Hi,
I want to customise entry style of ios to android style..Please help
Thanks
In our app, we can create a drawing in SkiaSharp that is made up of straight lines, polylines and text. We can click the Save button and write out an image of the drawing. We would like to offer the option to reload the image or actually the instructions for recreating the image, display it on the device and allow the operator to continue editing.
Is there a tool that can help us do that?
What we thought of is to turn the instructions for drawing the image into JSON, save it locally and later to read in the JSON and use it to recreate the drawing and then continue editing. Is this done somewhere already? Is there another way to do this that we could learn from?
Thanks!
No matter what... xamarin keep coming up with new roadblock and new error... Each day it's something new...
anyone with any ideas on what is going on fro the error below?
Please note...a week ago I was some how apply to get this application to run on the IOS simulator as one day I do hope I will play able to put this application on or dev store.. one day... but each new day brings new wacky errors... I have to ask... does xamarin work???
I know some will answer yes... but I just don't understand why when you follow the guides the thing does not work... I mean seriously,... how do you doploy your app if you can't get it to run on the sim... but a few days before... it ran on the sim?? What changed??
This app runs on the Android simulator just fine... Any help would be appreciated.Thanks!
There was an unhandled exception trying to deploy and run your application. \nSystem.Exception:
The OutputPath property is not set for project 'NameOfTheApplication.iOS.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='iPhone'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.
More of this error:
t Xamarin.VisualStudio.MsBuild.MsBuildService.RunTarget(IProjectNode projectNode, String msbuildTarget, IProgressReport progress, IDictionary2 globalProperties, IDictionary
2 properties, Boolean runInProc) in E:\A_work\21\s\src\Core\VisualStudio\MsBuild\MsBuildService.cs:line 248
at Xamarin.VisualStudio.MsBuild.MsBuildService.RunTarget(IProjectNode projectNode, String msbuildTarget, IDictionary2 globalProperties, IDictionary
2 properties, Boolean runInProc) in E:\A_work\21\s\src\Core\VisualStudio\MsBuild\MsBuildService.cs:line 211
at Xamarin.VisualStudio.IOS.MonoTouchProjectProperties.<>c__DisplayClass31_0.<b__0>d.MoveNext() in E:\A_work\21\s\src\Core\VisualStudio.IOS\PropertyProviders\MonoTouchProjectProperties.cs:line 103
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at Merq.AsyncManager.Run(Func`1 asyncMethod) in E:\A_work\143\s\src\Async\Merq.Async.Core\Merq.Async.Core.Portable\AsyncManager.cs:line 58
at Xamarin.VisualStudio.IOS.MonoTouchProjectProperties.GetAppBundleDir(IProgressReport progress) in E:\A_work\21\s\src\Core\VisualStudio.IOS\PropertyProviders\MonoTouchProjectProperties.cs:line 99
at Xamarin.VisualStudio.IOS.MonoTouchFlavoredProject.GetRunSessionInfo(MonoTouchDevice device) in E:\A_work\21\s\src\Core\VisualStudio.IOS\ProjectSystem\MonoTouchFlavoredProject.cs:line 1250
at Xamarin.VisualStudio.IOS.MonoTouchFlavoredProject.RunApplication(MonoTouchDevice device, IProgressReport progress) in E:\A_work\21\s\src\Core\VisualStudio.IOS\ProjectSystem\MonoTouchFlavoredProject.cs:line 1199
at Xamarin.VisualStudio.IOS.MonoTouchFlavoredProject.DebugLaunch(__VSDBGLAUNCHFLAGS grfLaunch, IProgressReport progress) in E:\A_work\21\s\src\Core\VisualStudio.IOS\ProjectSystem\MonoTouchFlavoredProject.cs:line 1066
at Xamarin.VisualStudio.IOS.MonoTouchFlavoredProject.DebugLaunch(__VSDBGLAUNCHFLAGS grfLaunch) in E:\A_work\21\s\src\Core\VisualStudio.IOS\ProjectSystem\MonoTouchFlavoredProject.cs:line 973
I have a label within a flex layout that doesnt seem to adjust to the new height of a wrapped label. Is this a bug or am I missing something?
This is within a stack layout
There is still another full sentence after this that wont show up unless I manually enter a HeightRequest larger
Does someone have a code sample of how to do multithreaded SkiaSharp drawing? I'm trying to achieve that in a PCL, but I've not gotten any further.
What I'm trying to do is:
1. await method X in method A
2. in method X start a new Task which returns a SKImage
3. in method X create (and dispose when done) SKSurface
4. draw to the Canvas of created SKSurface
5. return SKSurface.Canvas.Snapshot
6. in method A draw the returned SKImage to the original SKCanvasView's Surface.Canvas
7. dispose the SKImage
8. dispose original SKCanvasView's Surface.Canvas
But at step 6 I get the following exception:
[Mono] Found as 'sk_canvas_draw_image'.
[mono-rt] Stacktrace:
[mono-rt]
[mono-rt] at <unknown> <0xffffffff>
[mono-rt] at (wrapper managed-to-native) SkiaSharp.SkiaApi.sk_canvas_draw_image (intptr,intptr,single,single,intptr) <0x0004f>
[mono-rt] at SkiaSharp.SKCanvas.DrawImage (SkiaSharp.SKImage,single,single,SkiaSharp.SKPaint) [0x00037] in <8e4c06e066264a27bdda5f7ce87d3a90>:0
[mono-rt] at MyView/<OnDrawGraph>d__6.MoveNext () [0x00177] in /.../Views/MyView.xaml.cs:72
[mono-rt] at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.InvokeMoveNext (object) [0x00006] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00073] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00004] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Runtime.CompilerServices.AsyncMethodBuilderCore/MoveNextRunner.Run () [0x00032] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction (object) [0x00006] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.Tasks.AwaitTaskContinuation.RunCallback (System.Threading.ContextCallback,object,System.Threading.Tasks.Task&) [0x00013] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run (System.Threading.Tasks.Task,bool) [0x00021] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.Tasks.Task.FinishContinuations () [0x000b5] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.Tasks.Task.FinishStageThree () [0x0003d] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Threading.Tasks.Task`1<TResult_REF>.TrySetResult (TResult_REF) [0x00050] in <3fd174ff54b146228c505f23cf75ce71>:0
[mono-rt] at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<TResult_REF>.SetResult (TResult_REF) [0x00040] in <3fd174ff54b146228c505f23cf75ce71>:0
The original code:
async void OnDrawGraph(object sender, SKPaintSurfaceEventArgs e)
{
var canvasWidth = e.Info.Width;
var canvasHeight = e.Info.Height;
using (var theCanvas = e.Surface.Canvas)
{
theCanvas.Clear(MyArgs.GraphBackgroundColor.ToSKColor());
using (var axesImage = await DrawAxes(args, theCanvas))
{
theCanvas.DrawImage(axesImage, 0, 0);
}
theCanvas.Flush();
}
}
// theCanvas is from old code and is not used anymore (gonna remove it if multithreading works)
async Task<SKImage> DrawAxes(MyArgs args, SKCanvas theCanvas)
{
return await Task.Run(() =>
{
using (var myCanvas = SKSurface.Create((int)args.GraphWidth, (int)args.GraphHeight, SKImageInfo.PlatformColorType, SKAlphaType.Premul))
using (SKPaint paint = new SKPaint())
{
int numberOfAxes = ...;
float axisYPosition = ...;
var axis = new Axis
{
Args = args,
YPosition = axisYPosition,
HeaderText = "1",
IsBaseXAxis = (i == 0)
};
axis.Draw(paint, myCanvas.Canvas);
}
return myCanvas.Snapshot();
});
}
Any help would be appreciated, as I'm highly stuck :-)
Guys.
How do i invoke/ call display alert/show message once my program did some logic in ViewModel (MVVM)?
E.g
Lets say the program done the login validation..how do i send back the login result to Login Page (assuming if login failed) ?