These are chat archives for AvaloniaUI/Avalonia

19th
Dec 2015
not very happy with ^ but perhaps an idea for Perspex
Separate validation trigger from binding update trigger
^is probably cleaner, think the sample is broken.
Darnell Williams
@Seeker1437
Dec 19 2015 14:02
:O
Yeah I just thinking about that :D
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:13
Guys, a question about WPF. I have "virtual" dialogs that are actually part of the main window and are located on some layer with semi-transparent background.
It looks like this: http://i.imgur.com/5DoOQyv.png
Now I need to somehow limit input focus to be limited to that dialog and disable all hotkeys (I'm getting menus when Alt is pressed for example)
Johan Larsson
@JohanLarsson
Dec 19 2015 17:14
you could use an adorner that covers the window
should block all clicks
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:16
Well, Tab key ignores that
So do Alt and hotkeys
Mouse isn't an issue, it's keyboard that is
Johan Larsson
@JohanLarsson
Dec 19 2015 17:16
ok
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:17
Basically I need to somehow capture keyboard inside the control
Johan Larsson
@JohanLarsson
Dec 19 2015 17:17
what about adding a previewkeydown and set alt to handled?
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:17
yep, but Tab will still be an issue
I want to keep input focus inside that dialog, not to disable Tab completely
Johan Larsson
@JohanLarsson
Dec 19 2015 17:18
I suck at focus but there is stuff
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:18
And hotkeys will be a pain
Johan Larsson
@JohanLarsson
Dec 19 2015 17:18
Check out Keyboard.TabNavigation or something
Darnell Williams
@Seeker1437
Dec 19 2015 17:18
One sec because I have done this before...
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:20
Oh
nice
Darnell Williams
@Seeker1437
Dec 19 2015 17:21
I didn't do it that way hmmm
Johan Larsson
@JohanLarsson
Dec 19 2015 17:22
I never did it
Use tabnavigation sometimes to cycle inside a grid for example
@kek you may be interested in this
will hopefully have a package ready tonight
WIP in the branch right now
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:24
Don't mention random people, they get email notifications
Johan Larsson
@JohanLarsson
Dec 19 2015 17:24
no idea what it means
Darnell Williams
@Seeker1437
Dec 19 2015 17:25
hmmm
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:25
By shortening nicknames and putting @ before them you send email to random people
Johan Larsson
@JohanLarsson
Dec 19 2015 17:25
oh, thanks, good to know
strange feature
I'm used to SO chat
Darnell Williams
@Seeker1437
Dec 19 2015 17:27
for mine it uses its own window, and injects a panel on top of parent window's contents (via ZIndex)
Nikita Tsukanov
@kekekeks
Dec 19 2015 17:28
Hm
Nope, won't work
There could be dialogs on top of other dialogs
And then things will be weird
Darnell Williams
@Seeker1437
Dec 19 2015 17:28
ah
something I have done before is a bool set in the window
something like....
private volatile bool _patching;

    public bool IsPatching
    {
      get
      {
        return this._patching;
      }
      protected set
      {
        Application.Current.Dispatcher.Invoke((Action) (() =>
        {
          this._patching = value;
          foreach (UIElement uiElement in this._disableWhilePatching)
            uiElement.IsEnabled = !value;
          this.MainCancelButton.IsEnabled = value;
          if (this.TokenSource != null)
            this.TokenSource.Dispose();
          this.TokenSource = new CancellationTokenSource();
        }));
      }
    }
Darnell Williams
@Seeker1437
Dec 19 2015 17:34
could do something like that except probably modify canexecute for the commands and disable all of the main controls
idk if that would even be useful, but this is what I did with my patcher for a game XD