2015-01-31 7 views
1

현재 CodePlex의 Modern UI를 사용하고 있습니다. 위대하고 사용하기 쉽지만 익숙하지 않은 수업과 이벤트가 있습니다. 예 : "Patients"및 "Configurations"라는 두 개의 GroupLink가 있습니다. 각 GroupLink에는 여러 페이지가 있습니다. 버튼 클릭 이벤트를 사용하여 한 페이지에서 다른 페이지로 이동하려했습니다. 그것은 효과가 있었다. 내가 GroupLink1의 페이지 1에 GroupLink2의 페이지 1에서 이동하려고 할 때, 그것은 여전히 ​​작동하지만, 문제는 스크린 샷 아래 표처럼 활성 GroupLink 대신 GroupLink1의 GroupLink2에 남아 있었다 :Modern UI 다른 링크에서 다른 페이지로 이동하는 방법

Configuration GroupLink2, I will click the New Entry

The page navigated to PatientPage, but the GroupLink is still GroupLink2

, BTW 나는 PatientsPage에 알레르기 (IrritantPage)에서 탐색 뒤에 코드를 사용 :

private void FilterControl_OnToPatientClick(object sender, RoutedEventArgs e) 
    {    
     NavigationCommands.GoToPage.Execute("/MainContents/PatientGridPage.xaml", this); 
    } 

그래서 나는이 문제를 어떻게 해결합니까? 여기

은 '내 MainWindow를, 환자의 탭 페이지 및 구성의 목록 페이지

현대의 창 (메인 화면)

<mui:ModernWindow x:Class="DentalProto.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="Dental" IsTitleVisible="True" 
        WindowStartupLocation="CenterScreen" 
        Width="1200" 
        Height="720"      
        ContentSource="/Pages/MainTabPage.xaml" 
        Closing="MainWindow_OnClosing" 
        > 

    <mui:ModernWindow.MenuLinkGroups> 
     <mui:LinkGroup DisplayName="User Name"> 
      <mui:LinkGroup.Links> 

       <mui:Link DisplayName="Patients" Source="/Pages/MainTabPage.xaml" /> 
       <mui:Link DisplayName="Configurations" Source="/Pages/ConfigurationsListNav.xaml" /> 

      </mui:LinkGroup.Links> 
     </mui:LinkGroup> 

     <mui:LinkGroup DisplayName="settings" GroupKey="settings"> 
      <mui:LinkGroup.Links> 
       <mui:Link DisplayName="software" Source="/Pages/SettingsPage.xaml" /> 
      </mui:LinkGroup.Links> 
     </mui:LinkGroup> 
    </mui:ModernWindow.MenuLinkGroups> 

    <mui:ModernWindow.TitleLinks> 
     <mui:Link DisplayName="settings" Source="/Pages/SettingsPage.xaml" /> 
     <mui:Link DisplayName="help" Source="https://www.facebook.com/" /> 
    </mui:ModernWindow.TitleLinks> 
</mui:ModernWindow> 

MAINTAB 페이지 (환자 페이지)

<UserControl x:Class="DentalProto.Pages.MainTabPage" 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:mui="http://firstfloorsoftware.com/ModernUI" 

      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="1280"> 
    <Grid > 
     <!-- TODO: set @SelectedSource --> 
     <mui:ModernTab Layout="Tab"> 
      <mui:ModernTab.Links> 
       <!-- TODO: set @Source --> 

       <mui:Link DisplayName="Patient" Source="/MainContents/PatientGridPage.xaml" /> 
       <mui:Link DisplayName="Treatment Record" Source="/MainContents/TreatmentFillInPage.xaml"/> 

      </mui:ModernTab.Links> 
     </mui:ModernTab> 
    </Grid> 
</UserControl> 

CONFIGURATIONLISTNAV (구성입니다 페이지)

<UserControl x:Class="DentalProto.Pages.ConfigurationsListNav" 
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:mui="http://firstfloorsoftware.com/ModernUI" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"> 
    <Grid Style="{StaticResource ContentRoot}"> 
     <!-- TODO: set @SelectedSource --> 
     <mui:ModernTab Layout="List"> 
      <mui:ModernTab.Links> 
       <!-- TODO: set @Source --> 
       <mui:Link DisplayName="Allergies" Source="/MainContents/IrritantGridPage.xaml"/> 
       <mui:Link DisplayName="Health Diseases" Source="/MainContents/HealthDiseaseGridPage.xaml"/> 
       <mui:Link DisplayName="Mouth Diseases" Source="/MainContents/MouthDiseaseGridPage.xaml"/> 
       <mui:Link DisplayName="Procedures" Source="/MainContents/ProcedureGridPage.xaml"/> 
       <mui:Link DisplayName="Dentists" Source="/MainContents/DentistGridPage.xaml"/> 
      </mui:ModernTab.Links> 
     </mui:ModernTab> 
    </Grid> 
</UserControl> 
+0

메인 페이지를 게시하십시오. XAML – corradolab

+0

거기에 충분하길 바랍니다. – Kokombads

답변

5

ModernTab 컨트롤 내에서 "페이지"탐색과 "탭"탐색을 혼합합니다.

ModernTab 컨트롤 안에 NavigationCommands.GoToPage.Execute을 호출하면 현재 "페이지"가 ​​아닌 현재 "탭"이 변경됩니다.

당신이 사용할 수있는 최고 수준의 페이지를 변경하려면 :

IInputElement target = NavigationHelper.FindFrame("_top", this); 
NavigationCommands.GoToPage.Execute("/Pages/BasicPage1.xaml", target); 

를 새 페이지가 다른 ModernTab 경우 당신은 다음 다른 탭의 기본 하나를 선택합니다, 당신은 장소에 몇 가지 추가에 넣어해야 암호. 예를 들어 매개 변수를 새 페이지에 전달할 수 있습니다. 이이 SO 답. 당신의 MainWindow.cs 생성자에서이 설정이 고민 할 수있는 사람들을위한

+0

효과가 있습니다! 나는 그것을 완전히 이해하지 못한다. 그러나 나는 의미를 알지 못한다. 그러나 작동한다. 그것은 모두 중요하다. – Kokombads

+0

나는 비슷하지만,'target'은'_top','_self','_parent '등 어떤 아이디어? –

+0

@ Mark Richman IContent 메서드 (OnFragmentNavigation 등)에서이 작업을 수행하지 않도록하십시오. 항상 null이 될 것입니다. – erem

1

: 당신이 페이지로 이동하려면 응용 프로그램의 일부를 다음

 Application.Current.MainWindow = this; 

이 실행 :

 IInputElement target = NavigationHelper.FindFrame("_top", Application.Current.MainWindow); 
     NavigationCommands.GoToPage.Execute("/NameOfYourPage.xaml", target); 
+0

당신은 남자 야 .. 슈퍼 남자 .. – Sayka