firstfloorsoftware / mui

Modern UI for WPF
Microsoft Public License
2.59k stars 755 forks source link

TitleLinks broken or bugged? Need help.. "Could not find ModernFrame target" #140

Open thedonmon opened 8 years ago

thedonmon commented 8 years ago

Hello, so far everything has been working flawlessly and haven't run into any issues. However, my MainWindow.xaml page has been messing up and will not navigate to the "/Pages/SettingsPage.xaml" page. The application crashes and tells me it cannot find the ModernFrame Target etc.

I have followed all tutorials for 4.5 and my MainWindow.xaml page looks exactly as it is supposed to. Are there any suggestions on how I should fix this issue?

If I move the <mui:Link></mui:Link> tag inside of the <mui:ModernWindow.TitleLinks> to the <mui:ModernWindow.MenuLinkGroups> group you can navigate to the settings page perfectly fine. However I do not want Settings in the menu, but near the top of the application. Code for reference:

<mui:ModernWindow x:Class="MyProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mui="http://firstfloorsoftware.com/ModernUI"
    Title="MyProject" IsTitleVisible="False"
    LogoData="F1 M 53.5714,57L 22.6286,57L 22.6286,51.987L 42.3496,26.0571L 24.2572,26.0571L 24.2572,19L 53.5714,19L 53.5714,23.8602L 34.2746,49.9428L 53.5714,49.9428L 53.5714,57 Z "
    ContentSource="/Pages/Home.xaml"
    Icon="favicon.ico" WindowStartupLocation="CenterScreen">
    <mui:ModernWindow.MenuLinkGroups>
        <mui:LinkGroup DisplayName="MyProject">
            <mui:LinkGroup.Links>
                <mui:Link x:Name="xamlHome" DisplayName="Home" Source="/Pages/Home.xaml" />
                <mui:Link x:Name="xamlImplementation" DisplayName="Implementation" Source="/Pages/ImplementationPage.xaml"/>
                <mui:Link x:Name="xamlMigration" DisplayName="Migration"/>
                <mui:Link x:Name="xamlTransition" DisplayName="Transition"/>
                <mui:Link x:Name="xamlUtilities" DisplayName="Utilities" Source="/Pages/Utilities/CDMAnalysis.xaml"/>
            </mui:LinkGroup.Links>
        </mui:LinkGroup>
    </mui:ModernWindow.MenuLinkGroups>

    <mui:ModernWindow.TitleLinks>
        <mui:Link x:Name="xamlSettings"DisplayName = "Settings" Source="/Pages/SettingsPage.xaml">
    </mui:ModernWindow.TitleLinks>

    <Rectangle HorizontalAlignment="Center" VerticalAlignment="Center" 
   Width="{Binding SystemParameters.PrimaryScreenHeight}" Height="{Binding SystemParameters.PrimaryScreenWidth}" Name="rectangle" />

</mui:ModernWindow>
andrewhenry3 commented 7 years ago

I ran into the same thing - basically adding any content to a ModernWindow can prevent the TitleLink navigator from finding the navigator frame. I'm sure there must be an approved way to extend a ModernWindow so the frame doesn't get displaced from its expected location, but I didn't work with it long enough to figure it out.