public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { // Get the BitmapImage if possible var image = value as BitmapImage; if (image == null) { return(value); } // Get the image's source URI if possible Uri uri = image.UriSource; if (uri == null) { return(value); } uri = ResolutionUtility.GetUriWithResolutionSuffix(uri); if (targetType == typeof(ImageSource)) { return(new BitmapImage(uri)); } return(uri); }
protected override void InitializeApplicationBar() { // Application Bar Icons AddAppBarNowPlayingButton(); AddApplicationBarIconButton(LocalizedStrings.SearchAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/Search.png"), () => NavigationManager.OpenSearchPage(CurrentDatabase)); AddApplicationBarIconButton(LocalizedStrings.MoreAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/Ellipsis.png"), AppBarMoreButton_Click); #if WP8 // Disabled for now //EnableAppleTVControlButton(); #endif }
protected void EnableAppleTVControlButton() { var button = new ApplicationBarIconButton(); button.Text = "Apple TV"; button.IconUri = ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/AppleTVControl.png"); button.Click += (sender, e) => OpenAppleTVControlDialog(); _appleTVControlButton = button; UpdateAppleTVControlButton(); }
public ChooseLibraryPage() { InitializeComponent(); DisableConnectionStatusPopup = true; LayoutRoot.DataContext = ServerManager.PairedServers; ApplicationBar = new ApplicationBar(); AddApplicationBarIconButton(LocalizedStrings.AddAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/Add.png"), ShowPairingDialog); AddApplicationBarMenuItem(LocalizedStrings.ManualPairingMenuItem, ShowManualPairingDialog); AddApplicationBarMenuItem(LocalizedStrings.AboutMenuItem, NavigationManager.OpenAboutPage); }
protected override void InitializeApplicationBar() { base.InitializeApplicationBar(); ApplicationBar.Mode = ApplicationBarMode.Minimized; // Icon Buttons AddAppBarNowPlayingButton(); AddApplicationBarIconButton(LocalizedStrings.BrowseLibraryAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/Browse.png"), () => NavigationManager.OpenLibraryPage(CurrentServer.MainDatabase)); AddApplicationBarIconButton(LocalizedStrings.SearchAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/Search.png"), SearchAppBarButton_Click); #if WP8 // Disabled for now //EnableAppleTVControlButton(); #endif }
public NowPlayingPage() { InitializeComponent(); // Set up Application Bar InitializeApplicationBar(); ApplicationBar.Mode = ApplicationBarMode.Minimized; //ApplicationBarMenuClosedOpacity = 0; ApplicationBar.BackgroundColor = (Color)Application.Current.Resources["PhoneBackgroundColor"]; // Icon Buttons AddApplicationBarIconButton(LocalizedStrings.BrowseLibraryAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/Browse.png"), () => NavigationManager.OpenLibraryPage(CurrentServer.MainDatabase)); AddApplicationBarIconButton(LocalizedStrings.SearchAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/Search.png"), () => NavigationManager.OpenSearchPage(CurrentServer.MainDatabase)); RebuildApplicationBarMenuItems(); ManipulationStarted += Page_ManipulationStarted; }
protected void AddAppBarNowPlayingButton() { _nowPlayingButton = AddApplicationBarIconButton(LocalizedStrings.NowPlayingAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/App.iTunes.png"), NavigationManager.OpenNowPlayingPage); }