Example #1
0
        public LiveGroupComboBox()
        {
            var source = new List<TextBlock>(5);
            source.Add(CommonUtils.CreateComoboxItem("(今天)", 0));
            source.Add(CommonUtils.CreateComoboxItem(string.Format("({0})", DateTime.Now.AddDays(1).ToString("MM月dd日")), 1));
            source.Add(CommonUtils.CreateComoboxItem(string.Format("({0})", DateTime.Now.AddDays(2).ToString("MM月dd日")), 2));
            source.Add(CommonUtils.CreateComoboxItem(string.Format("({0})", DateTime.Now.AddDays(3).ToString("MM月dd日")), 3));
            source.Add(CommonUtils.CreateComoboxItem(string.Format("({0})", DateTime.Now.AddDays(4).ToString("MM月dd日")), 4));

            _selectIndex = 0;
            this.ItemsSource = source;
            this.SelectedIndex = _selectIndex;

            this.SelectionChanged += LiveGroupComboBox_SelectionChanged;

            //_cmsFactory = new LiveCMSListFactory();
            //_cmsFactory.HttpSucessHandler += listFactory_HttpSucessed;
            //_cmsFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _sportsFactory = new LiveCenterSportsFactory();
            _sportsFactory.HttpSucessHandler += listFactory_HttpSucessed;
            _sportsFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _gamesFactory = new LiveCenterGameFacotry();
            _gamesFactory.HttpSucessHandler += listFactory_HttpSucessed;
            _gamesFactory.HttpFailorTimeOut += http_FailorTimeOut;
        }
Example #2
0
        public LiveChannelPage()
        {
            this.InitializeComponent();

            _listFactory = new LiveListFactory();
            _listFactory.HttpSucessHandler += listFactory_HttpSucessed;
            _listFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _sportsFactory = new LiveCenterSportsFactory();
            _sportsFactory.HttpSucessHandler += liveCenter_HttpSucessed;
            _sportsFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _gamesFactory = new LiveCenterGameFacotry();
            _gamesFactory.HttpSucessHandler += liveCenter_HttpSucessed;
            _gamesFactory.HttpFailorTimeOut += http_FailorTimeOut;

            _viewModel = new LiveListViewModel();
            _viewModel.Groups = new ObservableCollection<LiveListGroup>();
            this.DefaultViewModel["LiveChannels"] = _viewModel.Groups;

            _liveCenterViewModel = new ObservableCollection<LiveListGroup>();
            this.DefaultViewModel["LiveCenterSource"] = _liveCenterViewModel;

            _colCount = ScreenUtils.CreateColNum(119, 260);
            var gridHeight = 129 * _colCount + 30;
            satelliteGridView.MaxHeight = gridHeight;
            localtvGridView.MaxHeight = gridHeight;
            livecenterGridView.MaxHeight = gridHeight + 60;

            RequestDatas();
        }