Beispiel #1
0
        public DownloadPage()
        {
            InitializeComponent();

            downloadingList.ItemsSource = DownloadViewModel.Instance.DownloadingItems;
            downloadedList.ItemsSource  = DownloadViewModel.Instance.DownloadedItems;

            _callbacks = new Dictionary <object, PivotCallbacks>(2);
            _callbacks[downloadingPivotItem] = new PivotCallbacks
            {
                OnActivated    = DownloadingActive,
                OnBackKeyPress = DownloadingBackPress
            };
            _callbacks[downloadedPivotItem] = new PivotCallbacks
            {
                OnActivated    = DownloadedActive,
                OnBackKeyPress = DownloadedBackPress
            };

            _selectBar         = new ApplicationBarIconButton();
            _selectBar.IconUri = new Uri("/Images/AppBar/select.png", UriKind.Relative);
            _selectBar.Text    = "选择";
            _selectBar.Click  += selectBar_Click;

            _deletedBar         = new ApplicationBarIconButton();
            _deletedBar.IconUri = new Uri("/Images/AppBar/delete.png", UriKind.Relative);
            _deletedBar.Text    = "删除";
            _deletedBar.Click  += deletedBar_Click;
        }
Beispiel #2
0
        public ChannelTypePage()
        {
            InitializeComponent();

            selectedList.ItemsSource = ChannelTypeFactory.Instance.SelectedViewModel;
            moreList.ItemsSource     = ChannelTypeFactory.Instance.AllViewModel[1];

            _callbacks = new Dictionary <object, PivotCallbacks>(2);
            _callbacks[selectedPivotItem] = new PivotCallbacks
            {
                OnActivated    = SelectedPivotItemActive,
                OnBackKeyPress = SelectedPivotItemBackPress
            };
            _callbacks[morePivotItem] = new PivotCallbacks
            {
                OnActivated    = MorePivotItemActive,
                OnBackKeyPress = MorePivotItemBackPress
            };

            _selectBar         = new ApplicationBarIconButton();
            _selectBar.IconUri = new Uri("/Images/AppBar/select.png", UriKind.Relative);
            _selectBar.Text    = "选择";
            _selectBar.Click  += selectBar_Click;

            _pinBar         = new ApplicationBarIconButton();
            _pinBar.IconUri = new Uri("/Images/AppBar/pin.png", UriKind.Relative);
            _pinBar.Text    = "固定到首页";
            _pinBar.Click  += pinBar_Click;

            _unPinBar         = new ApplicationBarIconButton();
            _unPinBar.IconUri = new Uri("/Images/AppBar/unpin.png", UriKind.Relative);
            _unPinBar.Text    = "取消固定";
            _unPinBar.Click  += unPinBar_Click;
        }
Beispiel #3
0
        public FirstPage()
        {
            InitializeComponent();

            _callbacks = new Dictionary <object, PivotCallbacks>(4);
            _callbacks[recommendPivotItem] = new PivotCallbacks
            {
                Init        = RecommendPivotItemBarInit,
                OnActivated = RecommendPivotItemBarActive
            };
            _callbacks[typePivotItem] = new PivotCallbacks
            {
                Init           = TypePivotItemInit,
                OnActivated    = TypePivotItemActive,
                OnBackKeyPress = TypePivotItemBackPress
            };
            _callbacks[personPivotItem] = new PivotCallbacks
            {
                OnActivated = personPivotItemActive
            };

            foreach (var callbacks in _callbacks.Values)
            {
                if (callbacks.Init != null)
                {
                    callbacks.Init();
                }
            }

            TiltEffect.TiltableItems.Add(typeof(SlidesShowControl));
            TiltEffect.TiltableItems.Add(typeof(LoginControl));

            _recCount = 9;
            _recommendChannelViewModel = new ChannelRecommendViewModel();

            _recommendNavFactory = new RecommendNavFactory();
            _recommendNavFactory.HttpSucessHandler += recommandNav_Successed;
            _recommendNavFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _cloudRecentGetFactory = new CloudGetFactory();
            _cloudRecentGetFactory.HttpSucessHandler += cloudRecentGetFactory_HttpSucess;

            _cloudFavolitenGetFactory = new CloudGetFactory();
            _cloudFavolitenGetFactory.HttpSucessHandler += cloudFavolitenGetFactory_HttpSucess;

            recommendList.ItemsSource = _recommendChannelViewModel;
            typeList.ItemsSource      = ChannelTypeFactory.Instance.SelectedViewModel;
            personalList.ItemsSource  = ChannelTypeFactory.Instance.LocalTypes;
            ChannelTypeFactory.Instance.HttpFailorTimeOut += http_FailorTimeOut;
            LoginPage.LoginSucessHandler = LoginSucess_Handler;
        }
Beispiel #4
0
        /// <summary>
        /// Initializes the dictionary of delegates to call when each pivot is selected
        /// </summary>
        public CcSongBook()
        {
            InitializeComponent();

            this.Loaded += CcSongBook_Loaded;


            _callbacks = new Dictionary <object, PivotCallbacks>();
            _callbacks[MultiselectLbxItem] = new PivotCallbacks
            {
                Init           = CreateEmailApplicationBarItems,
                OnActivated    = OnEmailPivotItemActivated,
                OnBackKeyPress = OnEmailBackKeyPressed
            };

            foreach (var callbacks in _callbacks.Values)
            {
                if (callbacks.Init != null)
                {
                    callbacks.Init();
                }
            }
        }
        /// <summary>
        /// Initializes the dictionary of delegates to call when each pivot is selected
        /// </summary>
        public LongListMultiSelectorSample()
        {
            InitializeComponent();

            this.Loaded += LongListMultiSelectorSample_Loaded;

            
            _callbacks = new Dictionary<object,PivotCallbacks>();
            _callbacks[MultiselectLbxItem] = new PivotCallbacks {
                Init = CreateEmailApplicationBarItems,
                OnActivated = OnEmailPivotItemActivated,
                OnBackKeyPress = OnEmailBackKeyPressed
            };
            _callbacks[BuddiesPivotItem] = new PivotCallbacks
            {
                OnActivated = SetupBuddiesApplicationBar,
                OnBackKeyPress = OnBuddiesBackKeyPressed,
            };
            _callbacks[GridModeItem] = new PivotCallbacks
            {
                Init = CreatePicturesApplicationBarItems,
                OnActivated = OnPicturesPivotItemActivated,
                OnBackKeyPress = OnGridBackKeyPressed
            };
            _callbacks[DataboundPivotItem] = new PivotCallbacks
            {
                OnActivated = SetupBoundBuddiesApplicationBar
            };
            foreach (var callbacks in _callbacks.Values)
            {
                if (callbacks.Init != null)
                {
                    callbacks.Init();
                }
            }
        }
Beispiel #6
0
        /// <summary>
        /// Initializes the dictionary of delegates to call when each pivot is selected
        /// </summary>
        public LongListMultiSelectorSample()
        {
            InitializeComponent();

            this.Loaded += LongListMultiSelectorSample_Loaded;


            _callbacks = new Dictionary <object, PivotCallbacks>();
            _callbacks[MultiselectLbxItem] = new PivotCallbacks {
                Init           = CreateEmailApplicationBarItems,
                OnActivated    = OnEmailPivotItemActivated,
                OnBackKeyPress = OnEmailBackKeyPressed
            };
            _callbacks[BuddiesPivotItem] = new PivotCallbacks
            {
                OnActivated    = SetupBuddiesApplicationBar,
                OnBackKeyPress = OnBuddiesBackKeyPressed,
            };
            _callbacks[GridModeItem] = new PivotCallbacks
            {
                Init           = CreatePicturesApplicationBarItems,
                OnActivated    = OnPicturesPivotItemActivated,
                OnBackKeyPress = OnGridBackKeyPressed
            };
            _callbacks[DataboundPivotItem] = new PivotCallbacks
            {
                OnActivated = SetupBoundBuddiesApplicationBar
            };
            foreach (var callbacks in _callbacks.Values)
            {
                if (callbacks.Init != null)
                {
                    callbacks.Init();
                }
            }
        }
Beispiel #7
0
        public DdSongBookNew()
        {
            InitializeComponent();

            this.Loaded += DdSongBookNew_Loaded;

            _callbacks = new Dictionary <object, PivotCallbacks>();
            _callbacks[MultiselectLbxItem1] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong1PivotItemActivated,
                OnBackKeyPress = OnSong1BackKeyPressed
            };
            _callbacks[MultiselectLbxItem2] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong2PivotItemActivated,
                OnBackKeyPress = OnSong2BackKeyPressed
            };
            _callbacks[MultiselectLbxItem3] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong3PivotItemActivated,
                OnBackKeyPress = OnSong3BackKeyPressed
            };
            _callbacks[MultiselectLbxItem4] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong4PivotItemActivated,
                OnBackKeyPress = OnSong4BackKeyPressed
            };
            _callbacks[MultiselectLbxItem5] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong5PivotItemActivated,
                OnBackKeyPress = OnSong5BackKeyPressed
            };
            _callbacks[MultiselectLbxItem6] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong6PivotItemActivated,
                OnBackKeyPress = OnSong6BackKeyPressed
            };
            _callbacks[MultiselectLbxItem7] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong7PivotItemActivated,
                OnBackKeyPress = OnSong7BackKeyPressed
            };
            _callbacks[MultiselectLbxItem8] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong8PivotItemActivated,
                OnBackKeyPress = OnSong8BackKeyPressed
            };
            _callbacks[MultiselectLbxItem9] = new PivotCallbacks
            {
                Init           = CreateSongApplicationBarItems,
                OnActivated    = OnSong9PivotItemActivated,
                OnBackKeyPress = OnSong9BackKeyPressed
            };
            foreach (var callbacks in _callbacks.Values)
            {
                if (callbacks.Init != null)
                {
                    callbacks.Init();
                }
            }
        }