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

Changing theme from backstage is broken #263

Closed
maurosampietro opened this issue Feb 4, 2016 · 1 comment
Closed

Changing theme from backstage is broken #263

maurosampietro opened this issue Feb 4, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@maurosampietro
Copy link
Contributor

Themes are not applied correctly if you change it from the backstage.
In particular if you use non Fluent controls that don't close the backstage/ribbon when clicked.
The problem do not show up with Office 2013 style.

In the showcase if you add this tabItems you can test what i say:

<Fluent:BackstageTabItem Header="Change theme with fluent controls"
                        Content="Hello">
    <Fluent:BackstageTabItem.ContentTemplate>
        <DataTemplate>
            <StackPanel>           
                <Fluent:Button Background="Blue" Foreground="Black" Click="OnOffice2010SilverClick">Office 2010 Silver</Fluent:Button>
                <Fluent:Button Background="Blue" Foreground="Black" Click="OnOffice2010BlackClick">Office 2010 Black</Fluent:Button>
                <Fluent:Button Background="Blue" Foreground="Black" Click="OnOffice2010BlueClick">Office 2010 Blue</Fluent:Button>
                <Fluent:Button Background="Blue" Foreground="Black" Click="OnOffice2013Click">Office 2013 White</Fluent:Button>
                <Fluent:Button Background="Blue" Foreground="Black" Click="OnWindows8Click">Windows8 White</Fluent:Button>
            </StackPanel>
        </DataTemplate>
    </Fluent:BackstageTabItem.ContentTemplate>
</Fluent:BackstageTabItem>

 <Fluent:BackstageTabItem Header="Change theme with standard controls" Content="Hello">
        <Fluent:BackstageTabItem.ContentTemplate>
            <DataTemplate>
                <StackPanel>
                    <Button Click="OnOffice2010SilverClick">Office 2010 Silver</Button>
                    <Button Click="OnOffice2010BlackClick">Office 2010 Black</Button>
                    <Button Click="OnOffice2010BlueClick">Office 2010 Blue</Button>
                    <Button Click="OnOffice2013Click">Office 2013 White</Button>
                    <Button Click="OnWindows8Click">Windows8 White</Button>
                </StackPanel>
            </DataTemplate>
        </Fluent:BackstageTabItem.ContentTemplate>
    </Fluent:BackstageTabItem>
@batzen batzen added the Bug 🐞 label Feb 4, 2016
@batzen batzen added this to the 4.0.0 milestone Feb 4, 2016
@batzen batzen self-assigned this Feb 4, 2016
@batzen
Copy link
Member

batzen commented Feb 4, 2016

I still consider this a bug in WPF, but I found a workaround.

The reason why this issue occurs is because WPF does not find the ancestor of type Fluent:Backstage anymore.
The funny/sad thing is with this code:

<Condition Binding="{Binding IsOpen, RelativeSource={RelativeSource AncestorType={x:Type Fluent:Backstage}}}" Value="True" />
<Condition Binding="{Binding IsOpenAnimationEnabled, RelativeSource={RelativeSource AncestorType={x:Type Fluent:Backstage}}}" Value="True" />

Guess what happens here...
The first condition throws no binding error. The second one does, because the ancestor could not be found.

@batzen batzen changed the title Theme changing Theme changing from backstage is broken Feb 4, 2016
@batzen batzen changed the title Theme changing from backstage is broken Changing theme from backstage is broken Feb 4, 2016
@batzen batzen closed this as completed in 72e8de8 Feb 4, 2016
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

2 participants