Exemple #1
0
        public static void DispatchEvent(
            BrowserEventDescriptor eventDescriptor, string eventArgsJson)
        {
            var eventArgs       = ParseEventArgsJson(eventDescriptor.EventArgsType, eventArgsJson);
            var browserRenderer = BrowserRendererRegistry.Find(eventDescriptor.BrowserRendererId);

            browserRenderer.DispatchBrowserEvent(
                eventDescriptor.ComponentId,
                eventDescriptor.EventHandlerId,
                eventArgs);
        }
Exemple #2
0
        // We receive the information as JSON strings because of current interop limitations:
        // - Can't pass unboxed value types from JS to .NET (yet all the IDs are ints)
        // - Can't pass more than 4 args from JS to .NET
        // This can be simplified in the future when the Mono WASM runtime is enhanced.
        public static void DispatchEvent(string eventDescriptorJson, string eventArgsJson)
        {
            var eventDescriptor = Json.Deserialize <BrowserEventDescriptor>(eventDescriptorJson);
            var eventArgs       = ParseEventArgsJson(eventDescriptor.EventArgsType, eventArgsJson);
            var browserRenderer = BrowserRendererRegistry.Find(eventDescriptor.BrowserRendererId);

            browserRenderer.DispatchBrowserEvent(
                eventDescriptor.ComponentId,
                eventDescriptor.ReferenceTreeFrameIndex,
                eventArgs);
        }