我有一个自定义组件项目,我指的是另一个项目。
我需要在自定义组件的页面之间导航,所以我正在使用以下代码:
var frame = Application.Current.RootVisual as PhoneApplicationFrame;
frame.Navigate(new Uri("/CustomComponent;component/Page.xaml", UriKind.Relative));
现在,假设我的自定义组件具有这样的结构:
Root Folder
\_ Page.xaml
\_ Folder A
\_ BaseClass.cs
\_ Folder B
\_ Folder C
\_ Class.cs (extends BaseClass)
\_ Page2.xaml
我想调用一个方法,Class.cs
该方法返回一个字符串,允许我Page2.xaml
使用我发布的导航代码导航到。
所以,这个方法应该返回
/CustomComponent;组件/文件夹 B/文件夹 C/Page2.xaml
(这/CustomComponent;component/
是可选的,但我需要它来返回正确的文件夹结构以导航到页面)
我一直在尝试使用Directory
类,但GetCurrentDirectory()
方法返回和绝对路径指向应用程序的安装文件夹,我需要它是遵循组件结构的相对路径。