User Profile & Activity

Nicholas Lie Member
nicholas@intersoftsolutions.com
Page
of 3

Hi Domingo,

This is one of the issues that we're going to solve with our Crosslight v2 which is going to be launched the sometime around the end of this month to early May. Crosslight v2 will cover end-to-end process starting from data retrieval, paging, incremental load, pull to refresh, and much more. We'll keep you posted. Thanks!

Hi Domingo,

Sorry for the long wait. We have investigated this issue and it is confirmed as a bug. We'll patch this issue in the upcoming Crosslight v2 which will be released at the end of this month.

Hi Domingo,

How do you refresh the table view? Is it a manual refresh from the UITableViewController? Or is it a refresh from the ViewModel? 

If you need to intercept when view is disposed, you might want to override the Dispose method and call your custom logic before calling base.Dispose(isDisposing) there.

Also, can you help me check the HashCode of the list view model before you navigate to the detail? Then, when you go back to the list view model from the detail, can you verify that the HashCode is the same? (to ensure that the instance of the view model is the same, also might want to check the Items property of the list view model).

However, if the view model is null (point no. 4), that means when you go back from the detail view, you're getting a blank view?

Hi Domingo,

How do you refresh the table view? Is it a manual refresh from the UITableViewController? Or is it a refresh from the ViewModel? 

If you need to intercept when view is disposed, you might want to override the Dispose method and call your custom logic before calling base.Dispose(isDisposing) there. 

Hi Domingo,

Thanks for the question. Before I proceed, I would like to ask:

So basically you need to know when the view-level (your iOS project) OnViewCreated or ViewDidLoad is invoked by having a certain event in your view that triggers to a certain method in the view model (core project) ? If it's so, this could be problematic when you apply it across other platforms, since the lifecycles are different for each platform. Or, perhaps, you want to intercept view-level events? If it's so, you can do it right from the view controller itself. If I may suggest you to prepare methods in the view model, then can call something like 

this.ViewModel.YourMethod();

from the suitable events your view controller. Is this desirable? But keep in mind that this approach may not work for other platforms and you might lose the "shared" code capability.

If the Navigated event is called in the view model and you might want to check perform certain operations for specific platforms by utilizing the IApplicationService to check the current platform. Like so:

IApplicationService applicationService = this.GetService<IApplicationService>();
if (applicationService != null)
{
    IApplicationContext applicationContext = applicationService.GetContext();
    if (applicationContext != null)
    {
        OSKind operatingSystem = applicationContext.Platform.OperatingSystem;
        if (operatingSystem == OSKind.iOS)
        {
        }
        else if (operatingSystem == OSKind.Android)
        {
        }
    }
}

 Kindly clarify so that I can assist you further with this issue. Thanks!

Hi Domingo,

I tried modifying the MyInventory sample that comes with Mobile Studio installation, in the Item.FormMetadata.cs, I'm attempting to edit the Price field as such.

[StringInput(Placeholder = "Price", Alignment = TextAlignment.Right)]
[Layout(Style = LayoutStyle.DetailOnly)]
public static decimal Price;

Kindly see the attachment for the result. Thanks.

Hi Domingo,

We have updated the sample in the GitHub link below"

https://github.com/IntersoftSolutions/CustomBinding

In this sample, I used the SignaturePad Component. In order to reflect the image to view model, first of all, I use UISignaturePad as a view that subclasses the SignaturePadView component.  Create the ImageProperty in the UISignaturePad. Then, override the TouchesEnded Method from SignaturePad, and set the ImageProperty with latest image. Don't forget to give SetPropertyValue to the ImageProperty setter in order to reflect the ViewModel. The reflected value will be set in the ViewModel.

Thanks,

Nicholas

All times are GMT -5. The time now is 10:00 PM.
Previous Next