Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatMarkupExtension always rewrite my bindings on a single line #512

Open
Smallgiil opened this issue Sep 23, 2024 · 3 comments
Open

FormatMarkupExtension always rewrite my bindings on a single line #512

Smallgiil opened this issue Sep 23, 2024 · 3 comments
Labels

Comments

@Smallgiil
Copy link

Describe the bug
When setting "FormatMarkupExtension": false in my configuration file, XAML Styler still puts my "Binding" attributes on a single line.

To Reproduce
Steps to reproduce the behavior:

  1. Create a WPF project with a XAML file.
  2. Make sure the "FormatMarkupExtension" option of XAML Styler is set to false.
  3. Add this in the XAML:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <DataTemplate x:Key="DataTemplate1">
        <TextBlock Text="{Binding Path=Name,
                                  UpdateSourceTrigger=PropertyChanged}" />
    </DataTemplate>
</ResourceDictionary>
  1. Format the file (by saving it, for instance).
  2. See that the binding is on a single line:
    <TextBlock Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}" />

Expected behavior
When setting this setting to false, I expect that XAML Styler let me write my bindings on several lines.

External Configuration
See the attached configuration file (I had to add a ".json" extension to add it to this issue):
Settings.XamlStyler.json

Version Info (please complete the following information):

  • OS: Windows 10 Version 22H2 Build 19045.4894
  • Visual Studio: Professional 17.12.0 Preview 1
  • XAML Styler: 3.2404.2
@Smallgiil Smallgiil added the Bug label Sep 23, 2024
@jpgarza93
Copy link

jpgarza93 commented Sep 26, 2024

Could we have something that allows comma-separated values to go into newlines? This could come in handy with the Avalonia UI framework as well, specifically with style selectors:

<Style Selector="ContentControl Button,
                 ContentControl StackPanel,
                 ...">
    <Setter Property="IsVisible" Value="True" />
    <Setter Property="Opacity" Value="1" />
</Style>

@grochocki
Copy link
Contributor

When setting this setting to false, I expect that XAML Styler let me write my bindings on several lines.

@Smallgiil Can you try the following configuration to see if it achieves the formatting you are looking for?

@Smallgiil
Copy link
Author

@grochocki It does not seem to change much. With the example described in the issue, I still have the same behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants