Skip to content

Visual Studio Extension F4 Properties Window empty when editing axaml file #20094

@astroman133

Description

@astroman133

Describe the bug

I am new to AvaloniaUI and am struggling to understand the differences from WPF.
I am running VS 2022 version 17.14.20 and AvaloniaUI 11.10.7.0, recently downloaded from the VS Marketplace.

I am working on a simple Hello World desktop MVVM GUI application using AvaloniaUI, that was created using the MVVM template. I am targeting WSL. There are 3 annoying behaviors that I am seeing.

No errors are reported in the Output window.

  1. When I open the existing project in VS the axaml file is displayed in a horizontal layout with the XML file on the left and the preview window on the right. This is despite the fact that previously the vertical layout was selected with the preview window above the xaml window. Also, the preview is always at 100%, even though it was previously displayed at 66.67%. It appears that the previously selected layout is not remembered.

  2. The F4 Properties page is empty when I expect it to display either the alphabetical or categorized list of properties for the focused control.

  3. Setting the main window's WindowStartupLocation to Manual and the Position to "100,100" has no effect. The application always starts at "0,0".

  4. and 2) above occur regarddless of whether Windows or WSL are targeted. Whereas 3) only occurs when WSL is targeted. It is strange since X11 has a method XConfigureWindow that supports setting the window's X and Y position.

These seem like basic functionalities that should just work for a mature technology. If they are designed to work differently, an error should be reported back to the developer.

Not sure that I should spend any more time on this if a simple app with one View and 4 controls does not work!

Thanks.

Rick Burke

To Reproduce

  1. Create an AvaloniaUI MVVM C# app from the installed template.

  2. Open MainWindow.axaml.

  3. Notice that the layout is horizontal and the previewer magnification is 100% .

  4. Change to vertical layout and 50% magnification.

  5. Save and close the solution

  6. Open the solution.

  7. Notice that the layout is horizontal and the magnification is 100%.

  8. While viewing MainWindow.axaml from above, select the control and press F4 to display the Window properties.

  9. Notice that no properties are displayed.

  10. Edit MainWindow.axaml to set the WindowStartupLocation to Manual and the Position to "100, 100".

  11. Build and run the application.

  12. Notice that the Window appears at a location that is offset from the upper left of the screen. This is as expected

  13. Change the dropdown in the toolbar to target WSL and re-run the program.

  14. Notice that the app's window is at 0,0.

Throughout execution of these steps

Expected behavior

See the Steps to Reproduce section above

Avalonia version

11.10.7

OS

Windows

Additional context

building both for Windows 11 and WSL.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions