Ejemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\MainWindow.xaml"
                ((Weather.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.weatherContentView = ((Weather.WeatherContentInfoView)(target));
                return;

            case 3:
                this.scrollview = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 4:
                this.stackpanel = ((System.Windows.Controls.StackPanel)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 城市信息属性变化时处理城市信息显示
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void CityInfoPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            WeatherContentInfoView weatherContentInfoView = d as WeatherContentInfoView;
            CityInfo cityInfo = e.NewValue as CityInfo;

            weatherContentInfoView.txtBlkProvince.Text   = cityInfo.parent; //获取省信息
            weatherContentInfoView.txtBlkRegion.Text     = cityInfo.city;   //获取城市信息
            weatherContentInfoView.TxtBlkUpdateTime.Text = cityInfo.updateTime;
        }
Ejemplo n.º 3
0
        private static void DataPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            WeatherContentInfoView weatherContentInfoView = d as WeatherContentInfoView;

            if (e.NewValue == null)
            {
                return;
            }
            Data data = e.NewValue as Data;

            weatherContentInfoView.TxtBlkShiDu.Text          = data.shidu;
            weatherContentInfoView.TxtBlkPm25.Text           = data.pm25;
            weatherContentInfoView.TxtBlkPm10.Text           = data.pm10;
            weatherContentInfoView.TxtBlkKongQiZhiLiang.Text = data.quality;
            weatherContentInfoView.TxtBlkWenDu.Text          = data.wendu;
            weatherContentInfoView.TxtBlkJianKangTiXing.Text = data.ganmao;
        }