Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 81910 articles
Browse latest View live

Android ListView Context Actions

$
0
0

We are using Xamarin.Forms and have a fairly standard ListView with some Context Actions in the ViewCell.

    <StackLayout>
    <!-- Place new controls here -->
    <ListView x:Name="ItemList" SelectionMode="Single">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.ContextActions>
                        <MenuItem Text="Action 1" IsDestructive="False"/>
                    </ViewCell.ContextActions>
                    <Label Text="{Binding .}" Margin="12"/>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</StackLayout>

On iOS these action appear when you swipe the list item, on Android it seems you have to do a Long Press to show the action bar, this is fine but our problem is when you do long press the item isn't highlighted.

This is made even worse if you single click an item, this is then highlighted you then long press a different item and the action bar appears but the first item is still selected (although the action is bound to the item that was long pressed).

Is there a simple solution to this as selecting and performing actions on a list items is a fairly standard pattern and currently on Android it isn't a great user experience.


Xamarin forms: Previous screen is showing behind the current screen of ios app.

$
0
0

Found the same issue here. But the solution there not help me out.

Please have a look at the following screenshot of my xamarin forms ios app.

enter image description here

My problem is the previous page is showing behind the current screen. I am using visual studio for mac and Xcode 11.2.1 for development.

How can I get the fullscreen view for pages?

Allow the Editor control to grow as content lines are added

$
0
0

I have been modifying the Todo app that uses Forms and replaced the note Entry class with the Editor class, so the todo can hold multiline notes. However the editor does not expand as new lines are entered. I have a Forms Editor Control nested inside a stack layout / scroll view - how do I allow the editor to grow each time the user enters another line of data? I had some success by count the '\n' characters in the text each time it changes and making a HeightRequest to the Editor, but I don't know how to calculate the exact extra height to add for each row in a reliable way. This process also feels clunky too. Can the editor control not be told to simply grow as new content is added by the user?

Update Firmware of Nordic BLE DFU

$
0
0

Hi everybody,
Does anyone know how to implement Nordic DFU Service in Xamarin forms and update Firmware of BLE device?

Thanks

Getting Native View of Xamarin Forms Custom Control (Android)

$
0
0

Hi,
I need to embed a forms control in a existing native xamarin application.
The native android controls are placed inside a linear layout.
The new forms control should be rendered next to the native controls.

Regards
Ronny

Issue with Android 10

$
0
0

I've been experiencing this issue with my current app after setting target framework to android:targetSdkVersion="29". I've double checked that this happens with a sample application for easier debugging. This is replicated with the WorkingWithNavigation sample app.

Anytime a page is pushed or popped off the navigation stack this error occurs. I'm assuming this has to do with the animation of the navigation.
Any ideas or thoughts on how to fix this issue?

11-09 11:57:51.138 W/avigation.Droi(18447): Accessing hidden field Landroid/view/animation/Animation;->mListener:Landroid/view/animation/Animation$AnimationListener; (greylist-max-p, reflection, denied)
11-09 11:57:51.139 E/FragmentManager(18447): No field with the name mListener is found in Animation class
11-09 11:57:51.139 E/FragmentManager(18447): java.lang.NoSuchFieldException: No field mListener in class Landroid/view/animation/Animation; (declaration of 'android.view.animation.Animation' appears in /system/framework/framework.jar!classes3.dex)
11-09 11:57:51.139 E/FragmentManager(18447): at java.lang.Class.getDeclaredField(Native Method)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.getAnimationListener(FragmentManager.java:1301)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.setHWLayerAnimListenerIfAlpha(FragmentManager.java:1283)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.completeShowHideFragment(FragmentManager.java:1746)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1822)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2625)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2411)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2366)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2273)
11-09 11:57:51.139 E/FragmentManager(18447): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:733)
11-09 11:57:51.139 E/FragmentManager(18447): at android.os.Handler.handleCallback(Handler.java:883)
11-09 11:57:51.139 E/FragmentManager(18447): at android.os.Handler.dispatchMessage(Handler.java:100)
11-09 11:57:51.139 E/FragmentManager(18447): at android.os.Looper.loop(Looper.java:214)
11-09 11:57:51.139 E/FragmentManager(18447): at android.app.ActivityThread.main(ActivityThread.java:7356)
11-09 11:57:51.139 E/FragmentManager(18447): at java.lang.reflect.Method.invoke(Native Method)
11-09 11:57:51.139 E/FragmentManager(18447): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
11-09 11:57:51.139 E/FragmentManager(18447): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

If file excist else open other one

$
0
0

I am using this to open a file in google docs in a webview

Webview.Source = "https://docs.google.com/document/d/1R_veGr31e39d4gJa0CtAdzU5BxDl5ZV-2bssofU8wSU/edit?usp=sharing";

But when it is not there i want to open another one as backup.
When removing the first from google docs it is not opening the second one

Trying to make a if statement , no luck

` if (File.Exists("https://docs.google.com/document/d/1R_veGr31e39d4gJa0CtAdzU5BxDl5ZV-2bssofU8wSU/edit?usp=sharing"))
{
Webview.Source = "https://docs.google.com/document/d/1R_veGr31e39d4gJa0CtAdzU5BxDl5ZV-2bssofU8wSU/edit?usp=sharing";

            }
          else
            Webview.Source = "https://docs.google.com/document/d/1JtPBbacWjjE1RnqT7MlliexLFk618iNS5yUBBCkh1bs/edit?usp=sharing";
        {

            }
    }`

Reading from Bluetooth freezes the app

$
0
0

Recently I have been building an app that allows Bluetooth communication. I have been following this documentation and I got the connection working. Since it is a blocking call the popup message disapears when another person clicks connect. But now I cant find the error when receiving. The sending doesnt post an error. But when checking if receive returns a value, both apps run unresponsive without any error or crash. I call the code with buttons like this (with dependency service):

`private void SendData(object sender, EventArgs e)
{
    string test = "Testing";
    byte[] temp = Encoding.ASCII.GetBytes(test);
    DependencyService.Get<BluetoothManager>().write(temp);
}

private void CheckButton(object sender, EventArgs e)
{
    if (DependencyService.Get<BluetoothManager>().read() != null)
    {
        CheckTxt.Text = "Ok";
    }
}`

The CheckButton is used to only check if something was returned.

And then this is my entire Bluetooth class:

` using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Bluetooth;
using Xamarin.Forms;
using ShareTheMusic.Droid;
using Java.Util;
using System.IO;

[assembly: Dependency(typeof(BluetoothManagerService))]
namespace ShareTheMusic.Droid
{
    public class BluetoothManagerService : BluetoothManager
    {
        BluetoothAdapter btAdapter = BluetoothAdapter.DefaultAdapter;
        BluetoothServerSocket mServerSocket = null;
        BluetoothSocket mSocket = null;
        BluetoothDevice mDevice = null;
        UUID uuid = UUID.FromString("30324d3a-3050-4e87-a159-f8fa6c433786");

        Stream mmInStream;
        Stream mmOutStream;
        byte[] mmBuffer = null;

        public string checkBluetooth(bool permition)
        {
            if (btAdapter == null)
            {
                return "NoBluetooth";
            }
            else
            {
                if (btAdapter.IsEnabled == false && permition != true)
                {
                    return "TurnOnBluetooth";
                }
                else if(permition == true)
                {
                    btAdapter.Enable();
                    return "AlreadyOn";
                }
                else
                {
                    return "AlreadyOn";
                }
            }
        }

        public string[] findBTdevices()
        {
            string[] deviceNames = null;
            deviceNames = (from qr in BluetoothAdapter.DefaultAdapter.BondedDevices select 
                           qr.Name).ToArray();
            return deviceNames;
        }

        public string discoverDevices()
        {
            return "not implemented yet";
        }

        public void acceptThread()
        {
            BluetoothServerSocket temp = null;

            try
            {
                temp = btAdapter.ListenUsingRfcommWithServiceRecord("ShareTheMusic", uuid);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Socket's listen() method failed", ex);
            }
            mServerSocket = temp;
        }


        public void runServerSide()
        {
            acceptThread();
            BluetoothSocket socket = null;

            while (true)
            {
                try
                {
                    socket = mServerSocket.Accept();
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("Socket's accept() method failed", ex);
                }

                if (socket != null)
                {
                    manageConnectedSocket(socket);
                    mServerSocket.Close();
                    break;
                }
            }
        }

        public void ConnectThread(BluetoothDevice device)
        {
            BluetoothSocket temp = null;
            mDevice = device;

            try
            {
                temp = device.CreateRfcommSocketToServiceRecord(uuid);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Socket's create() method failed", ex);
            }
            mSocket = temp;
        }

        public void runClientSide(string deviceName)
        {
            BluetoothDevice tmp = (from qr in BluetoothAdapter.DefaultAdapter.BondedDevices where 
                                        qr.Name == deviceName select qr).FirstOrDefault();
            ConnectThread(tmp);

            try
            {
                mSocket.Connect();
            }
            catch (Exception ex)
            {
                try
                {
                    mSocket.Close();
                }
                catch (Exception)
                {
                    System.Diagnostics.Debug.WriteLine("Could not close the client socket", ex);
                }
            }
            manageConnectedSocket(mSocket);
        }

        public void cancel()
        {
            try
            {
                mSocket.Close();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Could not close the connect socket", ex);
            }
        }

    /*---------------------*/

        public void manageConnectedSocket(BluetoothSocket socket)
        {
            mSocket = socket;
            Stream tmpIn = null;
            Stream tmpOut = null;

            try
            {
                tmpIn = socket.InputStream;
            }
            catch (IOException ex)
            {
                System.Diagnostics.Debug.WriteLine("Error occurred when creating input stream", ex);
            }
            try
            {
                tmpOut = socket.OutputStream;
            }
            catch (IOException ex)
            {
                System.Diagnostics.Debug.WriteLine("Error occurred when creating output stream", ex);
            }

            mmInStream = tmpIn;
            mmOutStream = tmpOut;
        }

        public List<byte[]> read()
        {
            mmBuffer = new byte[1024];
            int numBytes;
            List<byte[]> intBytes = new List<byte[]>();

            while (true)
            {
                try
                {
                    numBytes = mmInStream.Read(mmBuffer);
                    intBytes.Add(BitConverter.GetBytes(numBytes));
                }
                catch (IOException ex)
                {
                    System.Diagnostics.Debug.WriteLine("Input stream was disconnected", ex);
                    break;
                }
            }
            return intBytes;
        }

        public void write(byte[] bytes)
        {
            try
            {
                mmOutStream.Write(bytes);
            }
            catch (IOException ex)
            {
                System.Diagnostics.Debug.WriteLine("Error occurred when sending data", ex);
            }
        }
    }
}`

How share image for instagram, facebook?

$
0
0

How share image for instagram, facebook?

Binding on an indexer in ListView with property as the key

$
0
0

Hi guys,

I'm trying to localize my app with translation at runtime. Following many tutoriels, I have a ResourceManager wrapped into a ResourceProvider class which contains an indexer. My ViewModelBase class defines an instance of that ResourceProvider so that my ViewModel children class don't have to manage resources. And in my XAML pages, I bind to text using Text={Binding ResourceProvider[MyKey]} where MyKey is defined in Resources.resx

I face an issue using this in ListView. My ItemsSource is a Dictionary of categories, each category is a List of Scores (properties : PageName, DisplayName, Detail). What I wanted to do is:

```csharp
// Classes to define items ==> each has a constructor (not shown to clear code) to build objects
public class Score
{
    public string PageName { get; set; }
    public string DisplayName { get; set; }
    public string Detail { get; set; }
}

public class Category : List<Score>
{
    public string Name { get; set; }
    public string DisplayName { get; set; }
}

// A part of the ViewModel (I declare a CategoriesList property by calling GetCategoriesList() ; I also have a ScoreDictionary property that contains all scores)
public IList<Category> GetCategoriesList()
{
    return new List<Category>
    {
        new Category("HeartFailure", ScoreResources["HeartFailure"])
        {
            ScoreDictionary["PhhfGroup"],
            ScoreDictionary["BMI"]
        },
        new Category("Calculations", ScoreResources["Calculations"])
        {
            ScoreDictionary["BMI"]
        }
    };
}

// My Page code-behind
public partial class ScoreListPage : ViewPageBase
{
    protected ScoreListViewModel ViewModel { get; } = new ScoreListViewModel();

    public ScoreListPage()
    {
        InitializeComponent();
        this.BindingContext = ViewModel;
    }
}```


```xaml
<ListView
    ItemsSource="{Binding CategoriesList}"
    GroupDisplayBinding="{Binding DisplayName}"
    IsGroupingEnabled="True">
    <ListView.ItemTemplate>
        <DataTemplate>
            <TextCell Text="{Binding ResourceProvider[DisplayName]}"
                      Detail="{Binding ResourceProvider[Detail]}" />
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>```

But this doesn't work. Nothing is displayed, I think because the Binding in the ListView is on the ItemsSource, not on the ViewModel...

So I tried to use a converter to get the value from the ViewModel, this works at startup but does not permit translation at runtime (I have to close and reopen the app).

Any idea ?
Thanks.

Change font size printing bluetooth printer

$
0
0

Hello Everyone.

I am developing a multiplatform application, this makes the impression perfectly, but I would like to know how to change the font of the letter and be able to change some words in bold.

I use the Intermec PR2 bluetooth printer.

Picker Binding problem

$
0
0

Hi,

Having a Binding problem in a picker. SelectedItem property won't change according to the property selected before
navigating from that page a step back. After I move to that page again it's the default item(First) that's shown instead the
last I had picked e.g. Second or Third.

XAML:
<Picker Title="Map Type" SelectedItem="{Binding SelectedItemFromPicker}" ItemsSource="{Binding PickerOfItems}"

ViewM:
                private string _selectedItemFromPicker;
                public string SelectedItemFromPicker
                {
                     get { return _selectedItemFromPicker; }
                     set 
                     {
                            if (value != _selectedItemFromPicker)
                            {
                                if (value != null)
                                {
                                    _selectedItemFromPicker= value;

                                }
                                OnPropertyChanged(nameof(SelectedItemFromPicker));

                            }

                     }
                }


                private string[] _pickerOfItems;
            public string[] PickerOfItems
            {
                get { return _pickerOfItems; }
                set 
                {
                    if (value != _pickerOfItems)
                    {
                        _pickerOfItems= value;
                        OnPropertyChanged(nameof(PickerOfItems)); 
                    }
                }
            }

Constructor:

  PickerOfItems= new string[] { "First", "Second", "Third" };
  SelectedItemReturn = PickerOfMaps[0];

how to get the Entry CursorPosition in a TextChange Behavior ?

$
0
0

Hello,
I have an Entry for the user to enter a angle (example: 45°34.0')
So I have attached a behavior to the Entry to make a mask as described there: https://askxammy.com/applying-mask-in-xamarin-forms/
this is the xaml code:

            <Entry Text="{Binding Altitude}"
                   CursorPosition="{Binding AltitudeCursorPosition}">
                <Entry.Behaviors>
                    <behaviors:AltitudeEntryBehavior/>
                </Entry.Behaviors>
            </Entry>

That works well.
But:

  • The property Altitude in the ViewModel is set before the Behavior is executed (I guess there is no way that the mask would be applied before the bound property is set)
  • To improve the mask, I need to know the CursorPosition in the behavior. How can I get that information in the behavior?
    I could write all the code in the ViewModel but the mask is more a UI stuff rather than a logic stuff...

Thanks for your help

How to read from existing .db file?

$
0
0

I created questions.db file using DB Browser and want to read data from it in my Xamarin Forms application. That sounds pretty simple, right, but I'm 10+ hours stuck googling. Most answers just link to "Xamarin.Forms Local Databases" in microsoft docs.

Which explains nothing about the manually created database file, where to put it etc.

Some unofficial guides tell to put .db file to Resources/Assets folder for IOS/Droid, which seems right and I did.

I also added interfaces and [assembly: Dependency(typeof(DatabaseService))].... thing for android/ios, but failed. Everyone seems to use slightly different syntax, i haven't seen something for that in official docs, I'm completely lost.

Sorry for not posting any code, I'm not even sure which path to take, that's why I'm not diving into exact syntax right now.

Unable to add a LaunchScreen.Storyboard to a new XF app.

$
0
0

Hi Dear Reader, I have created a simple XF project in VS 2019 - latest upgrades, with Xamarin Forms (latest stable) using a Blank template. When I tried to add a LauncScreen.storyboard (becasue none was created in the template) I got the messages below.
When I created a new Tabbed project (including UWP) it created a LaunchScreen.storyboard, but when I double clicked it, the editor was opened but I got a similar set of errors.

Any ideas as to what is wrong with my installation?
Where can I find a site that has current instructions for creating a Launch screen in Xamarin Forms - iOS?
Thanks!
Will

System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> MonoTouch.Design.Client.InvalidSessionException: Error in the application.
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest(CommandRequest req, Boolean throwIfNotRunning) in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 235
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest[TResponse](CommandRequest req, Boolean throwIfNotRunning) in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 252
at MonoTouch.Design.Client.ServerProcessConnection.CreateSession() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 111
at MonoTouch.Design.Client.ServerProcessConnection.b__28_0() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 116
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result() at MonoTouch.Design.Client.IPhoneDesignerSession.<>c__DisplayClass289_11.b__1(Task1 t) in E:\A\_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 2073 at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at MonoTouch.Design.Client.IPhoneDesignerSession.<>c__DisplayClass289_01.<EnsureSession>b__0() in E:\A\_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 2139 at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- 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 MonoTouch.Design.Client.IPhoneDesignerSession.d__191.MoveNext() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 748
--- End of stack trace from previous location where exception was thrown ---
at MonoTouch.Design.Client.IPhoneDesignerSession.d__191.MoveNext() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 755
--- 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 MonoTouch.Design.Client.IPhoneDesignerSession.d__190.MoveNext() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 733
--- End of stack trace from previous location where exception was thrown ---
at MonoTouch.Design.Client.IPhoneDesignerSession.d__190.MoveNext() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 741
--- 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 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at MonoTouch.Design.Client.IPhoneDesignerSession.d__186.MoveNext() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 622
--- 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 MonoTouch.Design.Tasks.d__1.MoveNext() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Shared\TaskExtensions.cs:line 28
--- 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 MonoTouch.Design.Client.IPhoneDesignerSession.d__185.MoveNext() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 574
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> MonoTouch.Design.Client.InvalidSessionException: Error in the application.
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest(CommandRequest req, Boolean throwIfNotRunning) in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 235
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest[TResponse](CommandRequest req, Boolean throwIfNotRunning) in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 252
at MonoTouch.Design.Client.ServerProcessConnection.CreateSession() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 111
at MonoTouch.Design.Client.ServerProcessConnection.b__28_0() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 116
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result() at MonoTouch.Design.Client.IPhoneDesignerSession.<>c__DisplayClass289_11.b__1(Task1 t) in E:\A\_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\IPhoneDesignerSession.cs:line 2073 at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
---> (Inner Exception #0) MonoTouch.Design.Client.InvalidSessionException: Error in the application.
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest(CommandRequest req, Boolean throwIfNotRunning) in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 235
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest[TResponse](CommandRequest req, Boolean throwIfNotRunning) in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 252
at MonoTouch.Design.Client.ServerProcessConnection.CreateSession() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 111
at MonoTouch.Design.Client.ServerProcessConnection.b__28_0() in E:\A_work\129\s\Xamarin.Designer.iOS\MonoTouch.Design.Client\Connection\ServerProcessConnection.cs:line 116
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)<---
<---

and the listing goes on and on - way too long for this post...


How ProgressBar ProgressTo to make work?

$
0
0

Hi,

when i press button it just goes instantly without 1500 second.

<?xml version="1.0" encoding="utf-8" ?>

<StackLayout  VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">
    <ContentView x:Name="overlay" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All" IsVisible="False" BackgroundColor="#C0808080" Padding="10, 0">
        <ProgressBar x:Name="MyProgress" WidthRequest="500"
                 VerticalOptions="CenterAndExpand"
                 HorizontalOptions="Fill"/>
    </ContentView>
    <Button Text="MY TASKS"  Clicked="Button_Clicked"    />

</StackLayout>

using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace ProgressBar
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MainPage : ContentPage
{
float progress = 0f;
public MainPage()
{
InitializeComponent();
}

    async void Button_Clicked(object sender, EventArgs e)
    {

        progress += 0.2f;

        if (progress > 1)
        {
            progress = 0;
        }


        await MyProgress.ProgressTo(progress, 1500, Easing.Linear);

    }
}

}

What is wrong?

How can I get a list when I click on the button to navigate another page?

$
0
0

I am making a clone of Facebook (social network) that a publication has its list of comments
according to the id of the publication, I click on the button and get a list of comments on the publication.

Opening a datepicker view with the click event button in a toolbar item

$
0
0

Hello

I have a datepicker inside a stacklayout, what i want to do is open the datepicker when the user clicks a button (any button)

DatePicker startDate = new DatePicker
            {
                Format = "D",
                BackgroundColor = Color.Green,
                WidthRequest = width,
                MinimumDate = today,
            };

I have achieve this in android with the dependency service and using a "DatePickerDialog dialog"

but in windows phone I can't figure this out, I am currently doing something like this (in the windows phone class):

Microsoft.Phone.Controls.DatePicker test = new Microsoft.Phone.Controls.DatePicker();
Microsoft.Phone.Controls.DatePickerPage testie = new DatePickerPage();

        public PickerRenderer() 
        {
            test.Width = 0;
            testie.Width = 0;
            test.Height = 0;
            testie.Height = 0;
            this.Content = testie;
        }
        public void buttonClicked(Label aLbl)
        {
            test.Focus();
            testie.Focus();
        }

I have also tried gaining the focus of the element in Xamarin.forms like this:

if (Device.OS == TargetPlatform.WinPhone)
            {

                mainLayout.Children.Add(startDate);
                toolbarItem = new ToolbarItem("Add", "plus.png", () =>
                {

                    startDate.Focus();
                }, 0, 0);
                ToolbarItems.Add(toolbarItem); 
            }

But without any success, also there isn't a datepicker.open() or datepicker.show() function.

Any other ideas?

How to write/read Data Table in step definition from Scenario Outline in (Xamarin UI test, Specflow)

$
0
0

Hi, I want to know how to write/read/call Data Table values in step definition from Scenario Outline (feature file) in (Xamarin UI test, Specflow)

Feature: DataTable
@mytag
Scenario Outline: eating
Given there are cucumbers
When I eat cucumbers
Then I should have cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
| 10 | 5 | 5 |
| 15 | 10 | 5 |

Stepdefinition.cs

   [Given(@"there are (.*) cucumbers")]
    public void GivenThereAreCucumbers(int p0)
    {
        ScenarioContext.Current.Pending();
    }

    [When(@"I eat (.*) cucumbers")]
    public void WhenIEatCucumbers(int p0)
    {
        ScenarioContext.Current.Pending();
    }

    [Then(@"I should have (.*) cucumbers")]
    public void ThenIShouldHaveCucumbers(int p0)
    {
        ScenarioContext.Current.Pending();
    }

please let me know anyone having solution/examples for this.

how do i make a fly out menu on the right side of the screen

$
0
0

i wanna make a flyout menu on the right side of the screen rather then the left and wondering how.

Viewing all 81910 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>