/// <summary> /// Initializes a new instance of the PhotoAreaViewModel class. /// </summary> /// <param name="ocrData"> /// A reference to the OcrData instance that stores the /// photo stream and the text obtained after the OCR conversion. /// </param> /// <param name="ocrConversionStateManager"> /// A reference to the OcrConversionStateManager instance that stores the /// status of the last OCR conversion. /// </param> public PhotoAreaViewModel(OcrData ocrData, OcrConversionStateManager ocrConversionStateManager) : base(ocrData, ocrConversionStateManager) { this.OcrData.PropertyChanged += new PropertyChangedEventHandler(this.OcrData_PropertyChanged); // If the photo stream is available when this instance is created we'll call OnPhotoStreamChanged // to update all properties related to the photo. if (this.OcrData.PhotoStream != null) { this.OnPhotoStreamChanged(); } }
/// <summary> /// Initializes a new instance of the MainPage class. /// </summary> public MainPage() { this.InitializeComponent(); if (!this.CredentialsAreSet()) { return; } this.ocrData = OcrData.Instance; this.ocrData.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(this.OcrData_PropertyChanged); this.ocrConversionStateManager = OcrConversionStateManager.Instance; this.ocrConversionStateManager.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(this.ConversionStateManager_PropertyChanged); }
/// <summary> /// Initializes a new instance of the OcrViewModelBase class. /// </summary> /// <param name="ocrData"> /// A reference to the OcrData instance that stores the /// photo stream and the text obtained after the OCR conversion. /// </param> /// <param name="ocrConversionStateManager"> /// A reference to the OcrConversionStateManager instance that stores the /// status of the last OCR conversion. /// </param> public OcrViewModelBase(OcrData ocrData, OcrConversionStateManager ocrConversionStateManager) { if (ocrData == null) { throw new ArgumentNullException("ocrData"); } if (ocrConversionStateManager == null) { throw new ArgumentNullException("ocrConversionStateManager"); } this.OcrData = ocrData; this.OcrConversionStateManager = ocrConversionStateManager; }
private TextViewMode textViewMode; // Wrapped by this.TextViewMode /// <summary> /// Initializes a new instance of the TextAreaViewModel class. /// </summary> /// <param name="ocrData"> /// A reference to the OcrData instance that stores the /// photo stream and the text obtained after the OCR conversion. /// </param> /// <param name="ocrConversionStateManager"> /// A reference to the OcrConversionStateManager instance that stores the /// status of the last OCR conversion. /// </param> public TextAreaViewModel(OcrData ocrData, OcrConversionStateManager ocrConversionStateManager) : base(ocrData, ocrConversionStateManager) { }