Пример #1
0
 private async Task UpdateFocusZoneAsync()
 {
     try
     {
         var props = FocusZoneProps.GenerateProps(this, Id, RootElementReference);
         await jsRuntime.InvokeVoidAsync("BlazorFabricFocusZone.updateFocusZone", _registrationId, props);
     }
     catch (TaskCanceledException ex)
     {
     }
 }
Пример #2
0
        public static FocusZoneProps GenerateProps(FocusZone focusZone, string id, ElementReference root)
        {
            var props = new FocusZoneProps()
            {
                AllowFocusRoot                  = focusZone.AllowFocusRoot,
                CheckForNoWrap                  = focusZone.CheckForNoWrap,
                DefaultActiveElement            = new ElementReference(focusZone.DefaultActiveElement),
                Direction                       = focusZone.Direction,
                Disabled                        = focusZone.Disabled,
                DoNotAllowFocusEventToPropagate = focusZone.DoNotAllowFocusEventToPropagate,
                HandleTabKey                    = focusZone.HandleTabKey,
                Id = id,
                InnerZoneKeystrokeTriggers = focusZone.InnerZoneKeystrokeTriggers,
                IsCircularNavigation       = focusZone.IsCircularNavigation,
                OnBeforeFocusExists        = focusZone.OnBeforeFocus != null,
                Root = root,
                ShouldInputLoseFocusOnArrowKeyExists = focusZone.ShouldInputLoseFocusOnArrowKey != null
            };

            return(props);
        }
Пример #3
0
        private async Task <int> RegisterFocusZoneAsync()
        {
            var props = FocusZoneProps.GenerateProps(this, Id, RootElementReference);

            return(await jsRuntime.InvokeAsync <int>("BlazorFabricFocusZone.register", props, DotNetObjectReference.Create(this)));
        }
Пример #4
0
 private async Task UpdateFocusZoneAsync()
 {
     Debug.WriteLine("Focuszone updating...");
     var props = FocusZoneProps.GenerateProps(this, Id, RootElementReference);
     await jsRuntime.InvokeVoidAsync("BlazorFabricFocusZone.updateFocusZone", _registrationId, props);
 }