コード例 #1
0
        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);
        }
コード例 #2
0
        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
        }
コード例 #3
0
ファイル: RemoteBasePage.cs プロジェクト: misenhower/WPRemote
        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();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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
        }
コード例 #6
0
        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;
        }
コード例 #7
0
ファイル: RemoteBasePage.cs プロジェクト: misenhower/WPRemote
 protected void AddAppBarNowPlayingButton()
 {
     _nowPlayingButton = AddApplicationBarIconButton(LocalizedStrings.NowPlayingAppBarButton, ResolutionUtility.GetUriWithResolutionSuffix("/Assets/Icons/App.iTunes.png"), NavigationManager.OpenNowPlayingPage);
 }