These are chat archives for AvaloniaUI/Avalonia

27th
Apr 2018
danwalmsley
@danwalmsley
Apr 27 2018 10:51
@grokys you around
I'm looking at making context menus obey edge of screen
im thinking it might be nice to make it an option on popup
like KeepInsideScreenBoundaries = true
then when a popup opens it just snaps inside
that way people can take advantage of it, not only in context menus
do you think this is an ok approach or popup shouldn't know about this?
Jeremy Koritzinsky
@jkoritzinsky
Apr 27 2018 11:16
That sounds like a good idea.
danwalmsley
@danwalmsley
Apr 27 2018 11:18
@jkoritzinsky hey
would you know why the Screens object is a member of Window?
surely you don't even need a window to know what screens are available?
danwalmsley
@danwalmsley
Apr 27 2018 11:46
@jkoritzinsky @kekekeks im experimenting with this code in popup
protected virtual Point GetPosition()
        {
            var window = Window.OpenWindows.First();

            var result = GetPosition(PlacementTarget ?? this.GetVisualParent<Control>(), PlacementMode, PopupRoot, 
                HorizontalOffset, VerticalOffset);

            var screen = window.Screens.ScreenFromPoint(result);

            if(result.X + _popupRoot.Bounds.Width > screen.Bounds.Width)
            {
                result = result.WithX(result.X - (result.X + _popupRoot.Bounds.Width - screen.Bounds.Width));
            }

            return result;
        }
the issue is that I need to have the popup measured so I can know bounds before GetPosition is called
any suggestions on how this can be done, even though the popup hasn't been opened?
is it ok to just call measure anytime?
danwalmsley
@danwalmsley
Apr 27 2018 12:15
@jkoritzinsky @wieslawsoltes @kekekeks if any of you have a quick 5 minutes to review #1526 it makes the menus and context menus not overlap screen edges, id be very grateful, its a fairly small and simple PR ;)
Rayyan Tahir
@RayyanTahir
Apr 27 2018 14:14
Is PasswordBox implemented yet?
danwalmsley
@danwalmsley
Apr 27 2018 15:34
@RayyanTahir
I believe not
You could override the TextBox template to work around it,
However you password wouldn't be encrypted in memory or anything
Rayyan Tahir
@RayyanTahir
Apr 27 2018 15:36
@danwalmsley Thank you for your reply. Is there a roadmap that you guys could show for the public?
Jeremy Koritzinsky
@jkoritzinsky
Apr 27 2018 15:48
@RayyanTahir our general road map is basically our milestones on our issues at this point.
Rayyan Tahir
@RayyanTahir
Apr 27 2018 15:55
Right, thanks. Is Multibinding supported for XAML Controls?
Jeremy Koritzinsky
@jkoritzinsky
Apr 27 2018 16:49
Partially. We support OneWay MultiBindings currently.