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

Ribbon starts with no active tab selected #113

Closed
IdanBismut opened this issue May 17, 2015 · 9 comments
Closed

Ribbon starts with no active tab selected #113

IdanBismut opened this issue May 17, 2015 · 9 comments
Assignees
Labels
Milestone

Comments

@IdanBismut
Copy link

I'm using Fluent version 3.4.0 on VS2012 & .NET framework 4.

I have ribbon with empty backstage (so far) & 3 tabs.
Even though the designer loads it's OK (shows "tab1"),
when the GUI runs, there is no active tab selected !

I've tried to set on XAML the "IsSelected" property on the first tab, but that did not solve it.

I've placed on the app.xaml.cs inside OnStartup() function a line that "toggles" this, by doing:
app.ribbonTab.SelectedTabIndex = 1;
app.ribbonTab.SelectedTabIndex = 0;

That seemed to solve it only to find out caused another deeper bug -
now eventhough the firts tab is selected, no event are fired at all, till I select different tab & re-select back the first tab.

The mainWindow xaml code looks as follows:

[CODE]
<Fluent:Ribbon x:Name="ribbonTab" Grid.Row="0" Grid.ColumnSpan="2" Height="143" SelectedTabIndex="0">

        <!--Backstage-->
        <Fluent:Ribbon.Menu>
            <Fluent:Backstage>
            </Fluent:Backstage>
        </Fluent:Ribbon.Menu>

<Fluent:RibbonTabItem Header="tab1" IsSelected="True">

// ... trimmed for clearity of question

/Fluent:RibbonTabItem

<Fluent:RibbonTabItem Header="tab2">

// ... trimmed for clearity of question

/Fluent:RibbonTabItem

<Fluent:RibbonTabItem Header="tab3">

// ... trimmed for clearity of question

/Fluent:RibbonTabItem

/Fluent:Ribbon
[/CODE]

Any ideas ??

regards,
Idan

@batzen
Copy link
Member

batzen commented May 18, 2015

It works perfectly in the showcase application and in my own applications.
Would you mind posting a repro?

@batzen batzen added the Waiting for user response 😕 Waiting for the reporter to respond to questions made by maintainer. label May 20, 2015
@IdanBismut
Copy link
Author

Yes I can.
I'm sorry took me a while to respond back - I was away on vacation :)
I've uploaded to my google drive ZIP file with entire solution.
The IDE used to create it was VS2013.
https://drive.google.com/file/d/0B-3bSyUf3WULT0hEd3MtTUM3WTA/view?usp=sharing

Notice when running GUI.exe (or either doing F5 from within visual studio),
window loads, but no active tab is selected, unless we hover with mouse over the tab & then it's shown...

Setting IsSelected="true" does not work either...

Would appreciate if you can tell me what i'm doing wrong that cause this "bug"/"feature".

Thanks.

@PaleyX
Copy link

PaleyX commented Jun 9, 2015

I have the same problem. No button icons show in the designer and when run no tab is selected unless I hover the mouse over a tab or resize the window etc

@batzen
Copy link
Member

batzen commented Jun 9, 2015

This only happens when using the office 2010 theme.
The short time workaround would be to switch to the office 2013 theme by replacing

<ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Generic.xaml" />

with

<ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Office2013/Generic.xaml" />

@batzen batzen added Bug 🐞 and removed Waiting for user response 😕 Waiting for the reporter to respond to questions made by maintainer. labels Jun 9, 2015
@batzen batzen added this to the Next milestone Jun 9, 2015
@PaleyX
Copy link

PaleyX commented Jun 9, 2015

same here

@batzen batzen modified the milestones: Next, 3.4.1, 3.4.3, 3.4.2 Jul 7, 2015
@batzen
Copy link
Member

batzen commented Jul 10, 2015

This issue is related to state loading and the weird mechanism behind it.
Will have to refactor state loading.

@batzen batzen modified the milestones: 3.4.2, 3.4.3 Jul 10, 2015
@batzen batzen self-assigned this Jul 10, 2015
@batzen batzen closed this as completed in 68531e9 Jul 12, 2015
@dalpert-korewireless
Copy link

this is happening for me also in one app but not another, and using the 2013 theme does not impact it. still looking into differences between the one where it works and the one where it does not.

@dalpert-korewireless
Copy link

so I realized that this was working properly when I navigated from app.xaml to mainview.xaml by setting the StartUpUri in app.xaml:

<Application x:Class="MyApp.Desktop.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="Screens/MainWindow.xaml">
    <Application.Resources>
        <!--Attach Default Fluent Control's Theme-->
        <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Generic.xaml" />
    </Application.Resources>
</Application>

When I removed the StartupUri attribute:

<Application x:Class="MyApp.DesktopClient.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             >
    <Application.Resources>
        <!--Attach Default Fluent Control's Theme-->
        <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Generic.xaml" />
    </Application.Resources>
</Application>

and showed my main view in the App constructor

    public partial class App : Application
    {
        public App()
        {
            var bootstrapper = new AppBootstrapper();
            bootstrapper.Bootstrap();
        }
    }

then no tabs showed as open on startup.

Moving that MainWindow.Show() command from the App constructor to the OnStartup method made it work properly again:

    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var bootstrapper = new AppBootstrapper();
            bootstrapper.Bootstrap();
        }
    }

@batzen
Copy link
Member

batzen commented Nov 12, 2016

My guess, without testing, is that the resources are not fully loaded when you create your window in the apps constructor resulting in some things not working as expected.

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

4 participants