Share Contract - Problems & attempts & Solutions
Upcoming SlideShare
Loading in...5
×
 

Share Contract - Problems & attempts & Solutions

on

  • 3,467 views

 

Statistics

Views

Total Views
3,467
Views on SlideShare
2,405
Embed Views
1,062

Actions

Likes
1
Downloads
4
Comments
0

6 Embeds 1,062

http://www.saramgsilva.com 730
http://planet.portugal-a-programar.pt 191
http://saramgsilva.com 134
http://www.linkedin.com 5
http://webcache.googleusercontent.com 1
https://twitter.com 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Share Contract - Problems & attempts & Solutions Share Contract - Problems & attempts & Solutions Presentation Transcript

  • Share contract Case study Problems & Attempts & SolutionsBy @saramgsilva Windows 8
  • Share Contract Windows 8 I will use custom data format but could be another format. By @saramgsilva
  • Share Contract Windows 8 Summary • Goals • Share Contract behavior • Expected behavior for general development • The source application • The target application • Problems & Attempts & Solution • Phase 1 • Phase 2 • Conclusion By @saramgsilva
  • Share Contract Windows 8 Goals • Source Application o Share a custom data format (called MyDataFormatID) • Target Application o Received a custom data format (called MyDataFormatID) o Start the process o Do some steps (like navigation between pages but never return back) o Maybe in each step you can have a button for cancel the process o The process is only complete on the last page when you click done button • Implementing MVVM using MVVM Light Library By @saramgsilva
  • Share Contract Windows 8 Share Contract behavior Share is a way in which users can quickly exchange data from one app to another. With share, the focus is on quick scenarios that the user can complete with another app while staying in their original app. By @saramgsilva
  • Share Contract Windows 8 Share Contract behavior By @saramgsilva
  • Share Contract Windows 8 Expected behavior for general development • Navigation between pages: Frame.Navigate(typeof (MainPage));. • MVVM pattern : By @saramgsilva
  • Share Contract Windows 8 Expected behavior for general development • MVVM Light • ViewModelLocalor in App.xaml • MainViewModel for a ShareTargetPage By @saramgsilva
  • Share Contract Windows 8 Source Application • Page where the share is called: By @saramgsilva
  • Share Contract Windows 8 Source Application By @saramgsilva
  • Share Contract Windows 8 Target Application • Manifest: By @saramgsilva
  • Share Contract Windows 8 Target Application • In App.xaml.cs: By @saramgsilva
  • Share Contract Windows 8 Target Application • Active method in ShareTarget: By @saramgsilva
  • Share Contract Windows 8 Target Application • Active method in MainViewModel: I call • ReportStart • ReportDataRetrieved By @saramgsilva
  • Share Contract Windows 8 Target Application • The navigation in MainViewModel • The ShareOperation in MainViewModel I did not think much about it was provisional By @saramgsilva
  • Share Contract Windows 8 Source Application & Target Application knows the same data Note: I’m not focus in the schema of the custom data, it depend for each application. You can see more about it in: MSDN - Using schema-based formats. By @saramgsilva
  • Share Contract Windows 8 Problems - phase 1 1. Install source application (debug mode) 2. Install target application (debug mode) 3. Run source application and call the charm to share with target application I assume this happen because I did F5 for target application and then I close the application, but I did not stop the visual studio. I assume this because I started to do deploy only and it’s not happen. By @saramgsilva
  • Share Contract Windows 8 Problems - phase 1 I not sure if the both application are running in VS2012 or only the source application The errors were: By @saramgsilva
  • Share Contract Windows 8 Problems - phase 1 By @saramgsilva
  • Share Contract Windows 8 Problems - phase 1 By @saramgsilva
  • Share Contract Windows 8 Attempts - phase 1 My attempts for understand the problem: • Debugging to the Target application • Using the simulator • In Local machine It not works correctly and charm close all time. but I could sometimes • Logging to a file Failed because UnhandledException never occurs and in my steps I cannot catch the error. • Debug Options – check all • Read documentation and test samples, again! By @saramgsilva
  • Share Contract Windows 8 Attempts - phase 1 My attempts for understand the problem: • In source application subscribe the events • Destroyed • OperationCompleted • from data package • Note: sometimes I hit the Destroyed event! By @saramgsilva
  • Share Contract Windows 8 Problems - phase 1 Otherwise • Using only the Share Target Page with N user controls For each step change the visibility for the currents Return to the first code… continues to crash! By @saramgsilva
  • Share Contract Windows 8 Last attempt Create a project (Split Template) for a new target application: • Create N pages each page have 1 button and the page name • Try navigate between them Here I confirmed my opinion there is problem in navigation when I’m in the Share Charm By @saramgsilva
  • Share Contract Windows 8 Solution - phase 1 The Property lost the context In the share contract I cannot do this!!!! I did not know, all thinks that I read I did not found nothing about this By @saramgsilva
  • Share Contract Windows 8 Solution - phase 1 The right way: Do: var step2Page = new Step2Page(); step2Page.Activate(shareOperation); In the Active method do: Window.Current.Content = this; Window.Current.Activate(); By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2 Now I can navigate I still have problems • In debug mode, the application crash • I normal mode, I catch the errors By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2 Error FailedQI was detected By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2 FailedQI was detected Message: The call to QI for interface System.ComponentModel.PropertyChangedEventHa ndler with IID {50F19C16-0A22-4D8E-A089- 1EA9951657D2} failed with HRESULT 0x80004002 (No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))). One likely reason this failed is that the object does not have a proxy/stub dll properly registered. By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2 Error COM object that has been separated from its underlying RCW cannot be usedThis image is from the phase1 but this error still happen and is only images I have.I removed this! Only for see the message and object state. By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2This image is from the phase1 but this error still happen and is only images I have.I removed this! Only for see the message and object state. By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2I got this in phase 2 By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2I got this in phase 2 By @saramgsilva
  • Share Contract Windows 8 Problems - phase 2 Other errors: • A method was called at an unexpected time. (exception from HRESULT 0x8000000E) • UIASendMessageTimeOut I think it is because in the package I set a image but it is not correct I need to confirm By @saramgsilva
  • Share Contract Windows 8 Attempts Forum MSDN InvalidComObjectException in the target application (Sharing) UIASendMessageTimeout failed FailedQI was detected Contact to Laurent Bugnion (owner of the MVVM Light Library) about the FailedQI By @saramgsilva
  • Share Contract Windows 8 Reply Laurent Bugnion want to know more about the error. Let’s do crash the target application…. An estrange think happens, I didn´t know, the errors: InvalidComObjectException in the target application (Sharing) FailedQI was detected Occurs here: If I’m not wrong, InvalidComObjectException occurs in others places By @saramgsilva
  • Share Contract Windows 8 Reply For me this error: InvalidComObjectException in the target application (Sharing) Is something like the objects lost the context By @saramgsilva
  • Share Contract Windows 8 Solution – phase 2 I will remove the locator and the binding for each datacontext ViewModelLocator is a static resource By @saramgsilva
  • Share Contract Windows 8 Solution – phase 2 I did this In this case I don´t inject dependencies. I did my process for X times without close the source application and without an errors!! I was happy and I could not believe.  By @saramgsilva
  • Share Contract Windows 8 Conclusion Don´t use: Frame.Navigation Do: Active Page Don´t use: Static field/properties Cannot define the ViewModelLocator in App.xaml Cannot define the ViewModel using the binding for the DataContext Do: Initialize the ViewModel for each page in the constructor of the page I think: • The problem is not from MVVM Light • The developer do not expect this! By @saramgsilva
  • Share Contract Windows 8 Thanks SaraSilva geral@saramgsilva.com saramgsilva@gmail.com http://www.saramgsilva.com http://twitter.com/saramgsilva http://pt.linkedin.com/in/saramgsilva http://www.facebook.com/saramgsilva http://www.windowsphone.com/pt-PT/publishers/Sara%20Silva By @saramgsilva