예제 #1
0
 // Helper to raise any page event
 void RaisePageEvent(PageEventHandler handler, PageEventArgs e)
 {
     if (handler != null)
     {
         handler(this, e);
     }
 }
예제 #2
0
        // Notify pageclose to Mowbly JS layer
        void OnPageModelClosed(PageModel sender, PageEventArgs e)
        {
            bool isDeviceBackpress = (bool)e.Properties[Constants.KEY_IS_DEVICE_BACKPRESS];

            if (isDeviceBackpress)
            {
                InvokeJavascript("__mowbly__", "_onDeviceBackPressed");
            }
        }
예제 #3
0
        internal void Resume(bool isResumed, Dictionary <string, object> options = null,
                             string data = Constants.STRING_EMPTY)
        {
            if (isResumed)
            {
                // Resumed from stack
                // Update data and options
                Data          = (String.IsNullOrEmpty(data)) ? null : data;
                ShowProgress  = (bool)options["showProgress"];
                RetainInStack = (bool)options["retainPageInViewStack"];
            }

            // Raise OnResumed event
            PageEventArgs e = new PageEventArgs(this, new Dictionary <string, object>
            {
                { KEY_HAS_PAGE_RESUMED, isResumed }
            });

            RaisePageEvent(OnResumed, e);
        }
예제 #4
0
        // Notify pageresume to Mowbly JS layer
        void OnPageModelResumed(PageModel sender, PageEventArgs e)
        {
            Dictionary <string, object> preferences = new Dictionary <string, object>();

            string data = String.IsNullOrEmpty(Data) ? "{}" : Data;

            bool hasPageResumed = e.Properties.ContainsKey(KEY_HAS_PAGE_RESUMED) ?
                                  (bool)e.Properties[KEY_HAS_PAGE_RESUMED] : true;


            PageContext pageContext = new PageContext
            {
                Data             = data,
                PageName         = this.Name,
                Orientation      = (int)((PhoneApplicationPage)Mowbly.ActivePhoneApplicationPage).Orientation,
                PageParent       = this.Parent,
                WaitingForResult = !hasPageResumed,
                Preferences      = preferences
            };

            InvokeJavascript("__mowbly__", "_pageOpened", pageContext);
        }
예제 #5
0
 // Notify pageload to Mowbly JS layer
 void OnPageModelLoaded(PageModel sender, PageEventArgs e)
 {
     InvokeJavascript("__mowbly__", "_onPageLoad", PageContext);
 }