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

Backstage does not open at application start anymore #13

Closed
Alisaunder opened this issue Nov 8, 2014 · 9 comments
Closed

Backstage does not open at application start anymore #13

Alisaunder opened this issue Nov 8, 2014 · 9 comments
Assignees
Labels
Milestone

Comments

@Alisaunder
Copy link

For some reason it stopped working in my project. I had Backstage opening initially when run and specifically selecting the Recent Files Tab on Backstage. When I Compiled the new 3.0.3 into my project it seems to not be working now. I added a Print Tab to the TabItems around the same time but Removing that tabs contents don't seem to return the Backstage Is Open functionality.

I have a Trigger setup with OnIsOpenChanged and it triggers when the Window is supposed to be opening but now I get an error that Backstage cannot see one of my Tabs.

Could someone please confirm the backstage.IsOpen = true; command still opens the Backstage window? It would at least tell me it's something I've added in my code.

@batzen
Copy link
Member

batzen commented Nov 10, 2014

Could you post a small repro for that issue?
I can't reproduce it here.

@Alisaunder
Copy link
Author

I even tried to have the Window open on the Latest Fluent Test App.
If you go to line 75 in TestContent.xaml, add x:Name and ISOpenChanged

<Fluent:Backstage x:Name="backstage" IsOpenChanged="OnIsOpenChanged" Visibility="{Binding IsChecked, ElementName=UseBackstage, Converter={StaticResource boolToVisibilityConverter}}">

Now open TextContent.xaml.cs and add the following

inside public TestContent() add

backstage.IsOpen = true;

under Public TestContent() but inside public partial class TestContent add the following function

        /// <summary>
        /// Occurs when the Backstage panel opens or closes.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">A <see cref="BooleanPropertyChangedRoutedEventArgs"/> that contains the event data.</param>        
        private void OnIsOpenChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            // If opening, ensure the that the New is always selected
            if (backstage.IsOpen)
                BackStageRecent.IsSelected = true;
        }

Now this has worked for me in the past and was working until a few patches ago, but I've also added some other things to my code on the Backstage Window. So I'm trying to find out if it's stopped working in the later versions of Fluent all together or if something has changed in the procedure to get the window to open, or if it's my code I've added the following is my added code.

<!-- Backstage Print Tab -->
                        <Fluent:BackstageTabItem x:Name="BackStagePrint" Header="Print" KeyTip="P" >
                            <DockPanel LastChildFill="True">
                                <StackPanel x:Name="PrintControlsContainer" Orientation="Vertical">
                                    <TextBlock Margin="40,30,40,15" Foreground="#FF444444" Text="Print" FontSize="40" FontFamily="Segoe UI Light"/>
                                    <StackPanel Orientation="Horizontal" >
                                        <Button Margin="40,0,0,0" x:Name="buttonPrint" HorizontalAlignment="Left" VerticalAlignment="Top" Height="80" Width="80" Style="{DynamicResource Office2013ButtonStyle}" Command="commands:MHManagerCommands.Print" >
                                            <StackPanel Orientation="Vertical">
                                                <Image Source="pack://application:,,,/MHManager;Component/Resources/Images/printer32.png" Height="32" Width="32" />
                                                <TextBlock HorizontalAlignment="Center" Text="Print" />
                                            </StackPanel>
                                        </Button>
                                        <Fluent:Spinner Margin="8,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Value="1" InputWidth="70" Format="0" Header="Copies: " Style="{DynamicResource SpinnerStyle}"/>
                                    </StackPanel>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Margin="40,15,0,0" Grid.Column="0" HorizontalAlignment="Left" Text="Printer" FontSize="22" TextTrimming="CharacterEllipsis" Foreground="#FF2b579a" />
                                        <Image x:Name="PrinterStatus" Grid.Column="1" HorizontalAlignment="Right" Source="pack://application:,,,/MHManager;Component/Resources/Images/info11.png" Width="11" Height="11" DataContext="{Binding}">
                                            <Image.ToolTip>
                                                <ToolTip Width="210">
                                                    <StackPanel Orientation="Vertical">
                                                        <TextBlock FontWeight="SemiBold">
                                                                <Run Text="Printer Status"/>
                                                        </TextBlock>
                                                        <TextBlock />
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Margin="5,0,0,0" Text="Status: " />
                                                            <TextBlock Text="{Binding Path=PrinterStatus}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" />
                                                        </StackPanel>
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Margin="5,0,0,0" Text="Type: " />
                                                            <TextBlock Text="{Binding PrinterName}" />
                                                        </StackPanel>
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Margin="5,0,0,0" Text="Where: " />
                                                            <TextBlock Text="{Binding PrinterPort}" />
                                                        </StackPanel>
                                                        <TextBlock Margin="5,0,0,0" Text="Comment: " />
                                                        <TextBlock />
                                                    </StackPanel>
                                                </ToolTip>
                                            </Image.ToolTip>
                                        </Image>
                                    </Grid>
                                    <Fluent:ComboBox IsSynchronizedWithCurrentItem="True" x:Name="pList" Margin="40,5,0,0" DataContext="{Binding}" FontSize="11" ItemTemplate="{StaticResource pListMenuItems}" Header="{Binding Path=PrinterName, Mode=TwoWay}">
                                        <swi:Interaction.Triggers>
                                            <swi:EventTrigger EventName="SelectionChanged">
                                                <swi:InvokeCommandAction Command="commands:MHManagerCommands.PrintDeviceSelectionChanged" />
                                            </swi:EventTrigger>
                                        </swi:Interaction.Triggers>
                                        <Fluent:ComboBox.ToolTip>
                                            <ToolTip Width="Auto">
                                                <StackPanel Orientation="Vertical">
                                                    <TextBlock FontWeight="SemiBold" Text="Printer Status"/>
                                                    <TextBlock />
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Margin="5,0,0,0" Text="Status: " />
                                                        <TextBlock Text="{Binding Path=PrinterStatus}" TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Margin="5,0,0,0" Text="Type: " />
                                                        <TextBlock Text="{Binding Path=PrinterName}" />
                                                    </StackPanel>
                                                    <StackPanel Orientation="Horizontal">
                                                        <TextBlock Margin="5,0,0,0" Text="Where: " />
                                                        <TextBlock Text="{Binding Path=PrinterPort}" />
                                                    </StackPanel>
                                                    <TextBlock Margin="5,0,0,0" Text="Comment: " />
                                                    <TextBlock />
                                                </StackPanel>
                                            </ToolTip>
                                        </Fluent:ComboBox.ToolTip>
                                        <Fluent:ComboBox.Menu>
                                            <Fluent:RibbonMenu>
                                                <Fluent:MenuItem Header="Add Printer..."  />
                                                <Fluent:MenuItem Header="Print to File" />
                                            </Fluent:RibbonMenu>
                                        </Fluent:ComboBox.Menu>
                                    </Fluent:ComboBox>
                                    <TextBlock Margin="25,5,10,0" TextAlignment="Right" FontSize="12" ><Hyperlink x:Name="PrinterProperties" Foreground="#FF2b579a" Command="commands:MHManagerCommands.PrinterProperties"><Run Text="Printer Properties"/></Hyperlink></TextBlock>
                                    <TextBlock Margin="40,15,0,0" Grid.Column="0" HorizontalAlignment="Left" Text="Settings" FontSize="22" TextTrimming="CharacterEllipsis" Foreground="#FF2b579a" />
                                    <Fluent:ComboBox x:Name="dsListMenu" Margin="40,5,0,0" GroupBy="Tag" IsTextSearchEnabled="True" ResizeMode="Vertical" MinWidth="40" SizeDefinition="Large" SelectedIndex="0">
                                        <Button Tag="Document" x:Name="PrintAllPages" HorizontalContentAlignment="Left" Background="White" MaxWidth="300" BorderBrush="White">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="pack://application:,,,/MHManager;Component/Resources/Images/PrintAllPages.png" Width="32" Height="32" />
                                                <StackPanel Orientation="Vertical">
                                                    <TextBlock Margin="5,0,0,0" Text="Print All Pages" />
                                                    <TextBlock Margin="5,0,0,0" Text="The whole thing" />
                                                </StackPanel>
                                            </StackPanel>
                                        </Button>
                                        <Button Tag="Document" HorizontalContentAlignment="Left" Background="White" MaxWidth="300" BorderBrush="White">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="pack://application:,,,/MHManager;Component/Resources/Images/PrintSelection.png" Width="32" Height="32"  />
                                                <StackPanel Orientation="Vertical">
                                                    <TextBlock Margin="5,0,0,0" Text="Print Selection" />
                                                    <TextBlock Margin="5,0,0,0" Text="Just what you selected" />
                                                </StackPanel>
                                            </StackPanel>
                                        </Button>
                                        <Button Tag="Document" HorizontalContentAlignment="Left" Background="White" MaxWidth="300" BorderBrush="White">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="pack://application:,,,/MHManager;Component/Resources/Images/PrintCurrentPage.png" Width="32" Height="32"  />
                                                <StackPanel Orientation="Vertical">
                                                    <TextBlock Margin="5,0,0,0" Text="Print Current Page" />
                                                    <TextBlock Margin="5,0,0,0" Text="Just this page" />
                                                </StackPanel>
                                            </StackPanel>
                                        </Button>
                                        <Button Tag="Document" HorizontalContentAlignment="Left" Background="White" MaxWidth="300" BorderBrush="White">
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="pack://application:,,,/MHManager;Component/Resources/Images/PrintCustomRange.png" Width="32" Height="32"  />
                                                <StackPanel Orientation="Vertical">
                                                    <TextBlock Margin="5,0,0,0" Text="Custom Print" />
                                                    <TextBlock Margin="5,0,0,0" Text="Type specific pages, sections or ranges" TextTrimming="CharacterEllipsis" />
                                                </StackPanel>
                                            </StackPanel>
                                        </Button>
                                        <Button Tag="Document Info" HorizontalContentAlignment="Left" Background="White"  MaxWidth="300" BorderBrush="White">
                                            <StackPanel Orientation="Vertical">
                                                <TextBlock Margin="20,0,0,0" Text="Document Info" />
                                                <TextBlock Margin="20,0,0,0" Text="List of properties, such as file name, author and title" TextTrimming="CharacterEllipsis" />
                                            </StackPanel>
                                        </Button>
                                    </Fluent:ComboBox>
                                </StackPanel>
                                <Rectangle DockPanel.Dock="Left" Margin="50,60,0,30" Width="1" Fill="{StaticResource LargeVerticalSeparatorBrush}" HorizontalAlignment="Left" />
                            </DockPanel>
                        </Fluent:BackstageTabItem>

Basically I'm adding a print tab that resembles Office 2013

http://adamtdavis.com/screenshot.png

@batzen
Copy link
Member

batzen commented Nov 11, 2014

The easiest way to find out if it's your code or the library is to create a small project (for example copying and modifying the showcase application) which tries to reproduce the issue.

@Alisaunder
Copy link
Author

Well I figured if I couldn't get it to work using your example program then something wasn't right with the control. But I will create a small app to see.

@batzen
Copy link
Member

batzen commented Nov 12, 2014

You don't have to create something new. Just modify the showcase to show your issue,create a .zip package and attach it to this issue.

@Alisaunder
Copy link
Author

I have the modified showcase here it's the Fluent Test dotNet 4.5 version that is modified.
http://www.adamtdavis.com/Fluent.Ribbon-master.zip

@batzen
Copy link
Member

batzen commented Nov 12, 2014

I can't open rar archives,could you upload a zip archive instead?

@Alisaunder
Copy link
Author

Modified link

@batzen
Copy link
Member

batzen commented Nov 16, 2014

Now i finally get what you where doing.
Having the backstage open at application start.

@batzen batzen self-assigned this Nov 16, 2014
@batzen batzen closed this as completed in d4ead88 Nov 16, 2014
@batzen batzen changed the title Issue with BackStage Window being open at runtime. Issue with BackStage Window being open at application start. Nov 16, 2014
@batzen batzen changed the title Issue with BackStage Window being open at application start. Backstage does not open at application start anymore Nov 16, 2014
@batzen batzen modified the milestone: 3.1.0 Nov 16, 2014
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