locked
Remove chrome from floating parts RRS feed

  • Question

  •  

    I've been able to remove the chrome from a shell using the "WindowStyle" property. However this property won't cause any effect when used at the FloatingLayoutManager.

    I guess I should use some kind of template because the usual values "None", "SingleBorderWindow", etc are not allowed.

     

    Has anyone managed to do this?

     

    Thanks in advance.

    Friday, September 7, 2007 6:01 AM

Answers

  • Finally, I came up with the solution.

     

    Let me show this piece of code which also manages other style features:

     

    Code Snippet

     

    <Awx:Shell.LayoutManagers>
            <Awx:FloatingLayoutManager
                    x:Name="floatingLayoutManager"
                    StartupLocation="CenterParent"
                    ChildWindowsTopmost="True"
                    Parts="{Binding Path=Part.NavigationManager.ActiveParts}"
                >
                <Awx:FloatingLayoutManager.WindowStyle>
                    <Style TargetType="{x:Type Awx:FloatingPane}"
      BasedOn="{StaticResource {x:Type Awx:FloatingPane}}">
                        <Setter Property="OverridesDefaultStyle" Value="False"/>
                        <Setter Property="ToolTip" Value="{Binding Path=Title}"/>
                        <Setter Property="Background" Value="{x:Null}" />
                        <Setter Property="Foreground" Value="#FF3EC9D6"/>
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                        <Setter Property="Template">
                <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Awx:FloatingPane}">
                                    <Border x:Name="PaneBorder" Background="{TemplateBinding Background}"  Padding="1,1,1,1">
                                        <Awxt:TransitionElement x:Name="PART_PaneTransitionElement">
                                            <ContentPresenter x:Name="PART_PaneContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                        </Awxt:TransitionElement>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
            </Setter>
                        <Setter Property="WindowStyle" Value="None"/>
                        <Setter Property="AllowsTransparency" Value="True"/>
                    </Style>
                </Awx:FloatingLayoutManager.WindowStyle>

            </Awx:FloatingLayoutManager>
        </Awx:Shell.LayoutManagers>

     

     

    I hope someone can make good use of it.

     

     


     

    Tuesday, September 11, 2007 11:06 AM

All replies

  • The chrome should be removed using PaneStyle

    Friday, September 7, 2007 8:46 PM
  • Could you please be more specific? I've really tried it hard with no results.

    Saturday, September 8, 2007 11:14 PM
  • I don't have an environment where I can try this out on right now, but it should look something like this:

     

    <FlaotingLayoutManager>

      <FloatingLayoutManager.PartPaneStyle>

        <Style TargetType="{x:Type PartPane}">

          <Setter Property="ShowChrome" Value="False" />

        </Style

      </FloatingLayoutManager.PartPaneStyle>

    </FlaotingLayoutManager>

    Monday, September 10, 2007 8:06 PM
  • Yes, that was my first idea, but it won't work...

     

    Thanks anyway.

    Tuesday, September 11, 2007 8:32 AM
  • Finally, I came up with the solution.

     

    Let me show this piece of code which also manages other style features:

     

    Code Snippet

     

    <Awx:Shell.LayoutManagers>
            <Awx:FloatingLayoutManager
                    x:Name="floatingLayoutManager"
                    StartupLocation="CenterParent"
                    ChildWindowsTopmost="True"
                    Parts="{Binding Path=Part.NavigationManager.ActiveParts}"
                >
                <Awx:FloatingLayoutManager.WindowStyle>
                    <Style TargetType="{x:Type Awx:FloatingPane}"
      BasedOn="{StaticResource {x:Type Awx:FloatingPane}}">
                        <Setter Property="OverridesDefaultStyle" Value="False"/>
                        <Setter Property="ToolTip" Value="{Binding Path=Title}"/>
                        <Setter Property="Background" Value="{x:Null}" />
                        <Setter Property="Foreground" Value="#FF3EC9D6"/>
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                        <Setter Property="Template">
                <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Awx:FloatingPane}">
                                    <Border x:Name="PaneBorder" Background="{TemplateBinding Background}"  Padding="1,1,1,1">
                                        <Awxt:TransitionElement x:Name="PART_PaneTransitionElement">
                                            <ContentPresenter x:Name="PART_PaneContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                        </Awxt:TransitionElement>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
            </Setter>
                        <Setter Property="WindowStyle" Value="None"/>
                        <Setter Property="AllowsTransparency" Value="True"/>
                    </Style>
                </Awx:FloatingLayoutManager.WindowStyle>

            </Awx:FloatingLayoutManager>
        </Awx:Shell.LayoutManagers>

     

     

    I hope someone can make good use of it.

     

     


     

    Tuesday, September 11, 2007 11:06 AM