本文整理汇总了C#中INavigator.Navigate方法的典型用法代码示例。如果您正苦于以下问题:C# INavigator.Navigate方法的具体用法?C# INavigator.Navigate怎么用?C# INavigator.Navigate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类INavigator
的用法示例。
在下文中一共展示了INavigator.Navigate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComponentViewModel
public ComponentViewModel(string componentId, INavigator navigator, string componentDescription, IEnumerable<string> serviceDescriptions)
{
_description = componentDescription;
if (serviceDescriptions.Any())
_services += "–o " + string.Join(", ", serviceDescriptions);
GoToComponent = new RelayCommand(() => navigator.Navigate<string, ComponentDetailView>(componentId));
}
示例2: OpenSideMenuMenuCommand
public OpenSideMenuMenuCommand(INavigator navigator, ISessionManager sessionManager,IImageManager imageManager, IApiClient apiClient)
{
_sessionManager = sessionManager;
_imageManager = imageManager;
_apiClient = apiClient;
ExecuteCommand = new RelayCommand(arg => navigator.Navigate(Go.To.SideMenu()));
}
示例3: MovieSpotlightViewModel
public MovieSpotlightViewModel(Task<MoviesView> moviesViewTask, IImageManager imageManager, INavigator navigator, IApiClient apiClient, IServerEvents serverEvents,
IPlaybackManager playbackManager, ISessionManager sessionManager, ILogManager logManager)
{
_imageManager = imageManager;
_navigator = navigator;
_apiClient = apiClient;
_serverEvents = serverEvents;
_playbackManager = playbackManager;
_sessionManager = sessionManager;
_logger = logManager.GetLogger("Movies Spotlight");
SpotlightHeight = HomeViewModel.TileHeight*2 + HomeViewModel.TileMargin*2;
SpotlightWidth = 16*(SpotlightHeight/9) + 100;
_miniSpotlightWidth = HomeViewModel.TileWidth + (HomeViewModel.TileMargin/4) - 1;
LowerSpotlightWidth = SpotlightWidth/2 - HomeViewModel.TileMargin;
LowerSpotlightHeight = HomeViewModel.TileHeight;
BrowseMoviesCommand = new RelayCommand(arg => {
var itemParams = new ItemListParameters {
Items = GetMovies(),
Title = "Browse Movies"
};
navigator.Navigate(Go.To.ItemList(itemParams));
//await navigator.Navigate(Go.To.Item(await _apiClient.GetPersonAsync("Chris Pine", sessionManager.CurrentUser.Id)));
});
SpotlightViewModel = new ItemSpotlightViewModel(imageManager, apiClient) {
ImageType = ImageType.Backdrop,
ItemSelectedAction = i => navigator.Navigate(Go.To.Item(i))
};
AllMoviesImagesViewModel = new ImageSlideshowViewModel(imageManager, Enumerable.Empty<string>()) {
ImageStretch = Stretch.UniformToFill
};
MiniSpotlightItems = new RangeObservableCollection<ItemTileViewModel> {
CreateMiniSpotlightItem(),
CreateMiniSpotlightItem(),
CreateMiniSpotlightItem(),
};
LoadViewModels(moviesViewTask);
}
示例4: ItemTileViewModel
public ItemTileViewModel(IApiClient apiClient, IImageManager imageManager, IServerEvents serverEvents,
INavigator navigator, IPlaybackManager playbackManager, BaseItemDto item)
{
_imageManager = imageManager;
_navigator = navigator;
_playbackManager = playbackManager;
_item = item;
Image = new ItemArtworkViewModel(item, apiClient, imageManager);
Image.PreferredImageTypes = new[] { ImageType.Primary, ImageType.Thumb, ImageType.Backdrop };
Image.EnforcePreferredImageAspectRatio = true;
Image.PropertyChanged += (senger, args) => {
if (args.PropertyName == "Size") {
OnPropertyChanged("Size");
OnPropertyChanged("ShowDisplayName");
}
};
DisplayNameGenerator = GetDisplayNameWithAiredSpecial;
GoToDetailsCommand = new RelayCommand(async o => navigator.Navigate(Go.To.Item(Item)));
PlayCommand = new RelayCommand(o => _playbackManager.Play(new PlayOptions(Item) { GoFullScreen = true, EnableCustomPlayers = true, Resume = true }));
serverEvents.UserDataChanged += serverEvents_UserDataChanged;
}
示例5: Navigate
internal virtual bool Navigate(INavigator navigator, NavigationMode navMode)
{
Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
// This is fallback functionality if somebody creates a JournalEntry and gives it a URI.
if (this.Source != null)
{
return navigator.Navigate(Source, new NavigateInfo(Source, navMode, this));
}
else
{
Invariant.Assert(false, "Cannot navigate to a journal entry that does not have a Source.");
return false;
}
}
示例6: Navigate
/// <summary>
/// This override is used when doing journal navigation to a PF, not when it is resumed after
/// a child PF finishes.
/// </summary>
internal override bool Navigate(INavigator navigator, NavigationMode navMode)
{
Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
// Resume the PF and navigate to it.
// Special case: doing fragment navigation or CustomContentState navigation
// within a PF. Then don't create a new PF object!
IDownloader idl = navigator as IDownloader;
NavigationService ns = idl != null ? idl.Downloader : null;
Debug.Assert(ns != null, "Fragment navigation won't work when the INavigator doesn't have a NavigationService.");
PageFunctionBase pageFunction =
(ns != null && ns.ContentId == this.ContentId) ?
(PageFunctionBase)ns.Content : ResumePageFunction();
Debug.Assert(pageFunction != null);
return navigator.Navigate(pageFunction, new NavigateInfo(this.Source, navMode, this));
}
示例7: HomeCommand
public HomeCommand(INavigator navigator)
{
ExecuteCommand = new RelayCommand(arg => navigator.Navigate(Go.To.Home()));
}
示例8: NavigateMapper
private static bool NavigateMapper(ReceiverList<INavigator, NavigationParameter> list, INavigator receiver, NavigationParameter parameter)
{
return receiver.Navigate(parameter);
}
示例9: SearchMenuCommand
public SearchMenuCommand(INavigator navigator)
{
ExecuteCommand = new RelayCommand(arg => navigator.Navigate(Go.To.Search()));
}