2
Vote

Bug: Window.WindowStyle is position sensitive.

description

I really like this tool, but recently, I ran into a bug (actually, I think it's more an issue of MS, but those guys might be more difficult to persuade to change something than you) and I hope you can fix this.

When creating a wpf TaskBar project, I have a Window where the WindowStyle="None". When prettyfying the code with Xaml Markup Styler, this option is moved towards the end of the Window attributes (see BAD Example below). Unfortunately, when running the application, a XamlParseException exception is generated,

Hope you can fix this.

Thanks,
Erik

GOOD Example (Note the position of WindowStyle="None")
<Window x:Class="ScreenCappy.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converters="clr-namespace:ScreenCappy.Converters"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:screenCappy="clr-namespace:ScreenCappy"
        xmlns:videoCaptureLib="clr-namespace:VideoCaptureLib;assembly=VideoCaptureLib"
        xmlns:images="clr-namespace:ScreenCappy.Images"
        x:Name="UiMainNotifyWindow"
        WindowStyle="None"
        Title=""
        Width="250"
        Height="350"
        AllowsTransparency="True"
        Background="Transparent"
        BorderThickness="1"
        MouseEnter="uiWindowMainNotification_MouseEnter"
        MouseLeave="uiWindowMainNotification_MouseLeave"
        ResizeMode="NoResize"
        ShowInTaskbar="False"
        Topmost="True"
        Visibility="Visible"
        mc:Ignorable="d">
BAD Example (generates a XamlParseException: "WindowStyle.None is the only valid value for WindowStyle when AllowsTransparency is true.")
<Window x:Class="ScreenCappy.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:converters="clr-namespace:ScreenCappy.Converters"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:images="clr-namespace:ScreenCappy.Images"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:screenCappy="clr-namespace:ScreenCappy"
        xmlns:videoCaptureLib="clr-namespace:VideoCaptureLib;assembly=VideoCaptureLib"
        x:Name="UiMainNotifyWindow"
        Title=""
        Width="250"
        Height="350"
        AllowsTransparency="True"
        Background="Transparent"
        BorderThickness="1"
        MouseEnter="uiWindowMainNotification_MouseEnter"
        MouseLeave="uiWindowMainNotification_MouseLeave"
        ResizeMode="NoResize"
        ShowInTaskbar="False"
        Topmost="True"
        Visibility="Visible"
        WindowStyle="None"
        mc:Ignorable="d">

comments

twein wrote Apr 17, 2013 at 10:48 AM

I think this is more a customization than a bugfix:

You only have to add WindowStyle to the #6 Core layout ordering rules group elements in Xaml Styler options. It will place it before all misc elements (like AllowTransparency).