Windows-XAML / Template10

Making Windows 10 apps great again
Apache License 2.0
1.41k stars 390 forks source link

PageHeader and subfolders. #855

Closed mjenkins5720 closed 8 years ago

mjenkins5720 commented 8 years ago

Using the Hamburger Menu with views in the Views Folder, the navigate back behaves correctly, however if you place the page within a subfolder of Views (Views. Subfolder) the back navigation does not work. Are the paths in the Bootstrapper coded to the Views Folder?

JerryNixon commented 8 years ago

No they are not. I don't completely understand your question. You put a XAML file in a physical sub folder and the PageHeader look different? Would you provide some code and a screen shot please?

mjenkins5720 commented 8 years ago

The Project Directory Structure directorystructure

The ListEntry listpage

Code For the ListEntryPage <Page x:Class="EventsManager.Views.Lists.ListsEntryPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:Behaviors="using:Template10.Behaviors" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:controls="using:Template10.Controls" xmlns:c="using:EventsManager.Converters" xmlns:local="using:EventsManager.Views" xmlns:vm="using:EventsManager.ViewModels.Lists"

    <controls:PageHeader x:Name="pageHeader"
                         Frame="{x:Bind Frame}"
                         RelativePanel.AlignLeftWithPanel="True"
                         RelativePanel.AlignRightWithPanel="True"
                         RelativePanel.AlignTopWithPanel="True"
                         Text="Lists Page">
        <!--  secondary commands  -->
        controls:PageHeader.SecondaryCommands
            <AppBarButton />
            <AppBarButton />
            <AppBarButton />
        /controls:PageHeader.SecondaryCommands
    </controls:PageHeader>
    <StackPanel x:Name="buttonbar"
                RelativePanel.Below="pageHeader" 
                RelativePanel.AlignLeftWithPanel="True" 
                RelativePanel.AlignRightWithPanel="True" Orientation="Horizontal">
        <Button x:Name="btnDepartment" Content="Departments" HorizontalAlignment="Left"  VerticalAlignment="Top" Click="btnDepartment_Click" />
        <Button x:Name="btnMaterial" Content="Materials" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="btnMaterial_Click"/>
        <Button x:Name="btnCountry" Content="Countries" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="btnCountry_Click"/>
        <Button x:Name="btnColors" Content="Colors" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="btnColors_Click"/>

    </StackPanel>
    <Frame x:Name="listframe" 
           HorizontalAlignment="Stretch"  VerticalAlignment="Stretch" 
           RelativePanel.AlignLeftWithPanel="True" 
           RelativePanel.AlignRightWithPanel="True" 
           RelativePanel.AlignBottomWithPanel="True" 
           RelativePanel.Below="buttonbar" />
</RelativePanel>

The Main Page and the details page are in the Views folder

detailspage

settingspage

This is the same project I tried Navigating to a Frame

dubstylee commented 8 years ago

Have you tried clicking "back" multiple times? There is an issue with Behaviors 1.0.3 that causes the back stack to not work properly.

mjenkins5720 commented 8 years ago

Yes, I have creates multiple Apps using the templates, I also tried copying the page to the sub directory, the result is the same.

mjenkins5720 commented 8 years ago

I did not see this reply on Git Hub,

Yes you are correct, the page header code is identical on all three pages, the difference is their location on the project directory. The list page is the only one in a sub directory of Views.

From: dubstylee [mailto:notifications@github.com] Sent: Thursday, April 21, 2016 1:17 PM To: Windows-XAML/Template10 Template10@noreply.github.com Cc: mjenkins5720 mjenkins@modernarmour.net; Author author@noreply.github.com Subject: Re: [Windows-XAML/Template10] PageHeader Control Does not display properly if View are in a subfolder. (#855)

Looks to me like the PageHeader is the same for all of them. The PageHeader is the light blue colored section across the top. Unless I am misunderstanding your question, the only difference in the appearance is your ListEntry view has it's own "header" with the Departments, Materials, etc., that is unrelated to the PageHeader.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/Windows-XAML/Template10/issues/855#issuecomment-213023742 https://github.com/notifications/beacon/ARgHc-1Q72c2i21WSHWJH4t9O0WrmBjnks5p57EHgaJpZM4IMr3F.gif

JerryNixon commented 8 years ago

Can anyone (aka @Windows-XAML/community) reproduce this?

dubstylee commented 8 years ago

I created a new Hamburger application with a subfolder "Lists" under the "Views" folder. I created a new View called "AnotherPageView.xaml" and a ViewModel for it. Navigating to the new page works fine, and I get a back button on the page, and am able to navigate back to the previous page.@mjenkins5720, have you tried this since the recent updated packages? It seems to be working as expected.

mjenkins5720 commented 8 years ago

Thank guys for your time, I created a new T10 App, and added several test pages. Some with namespace Views.List and some in names[ace Views Other than the annoying blue squiggles they worked OK and the Back button displays correctly. My problem was,

  1. Navigation cache was disabled. 2, Clear history was "True". Maybe in next release you can add a second button to the hamburger menu so it can be easily copied around. (cut paste refactor).