コード例 #1
0
ファイル: UIFactory.cs プロジェクト: SehdiNassim/WeatherLab
        public static Image PredictionOutlookImage(Result result)
        {
            return(new Image()
            {
                Source = SvgIcon(ImagePaths.GetOutlookImagePath(result)),

                MaxHeight = 50,
                MaxWidth = 50,

                Margin = new System.Windows.Thickness(20, 0, 20, 0)
                ,
                ToolTip = StringFormater.GetClimate(result),
                Effect = shadowEffect
            });
        }
コード例 #2
0
        /// <summary>
        /// This method generate the most probable prediction Image with appropriate width and height and effect
        /// </summary>
        private void GenerateFirstOutcastImage()
        {
            Result result = predictionSystem.Result.Results[0];

            ///TODO : Change this to use Resources :
            //Uri imagePath = new Uri(@"" + ImagePaths.GetOutlookImagePath(result), UriKind.Absolute);
            outcastImage.Source            = UIFactory.SvgIcon(ImagePaths.GetOutlookImagePath(result));
            outcastImage.VerticalAlignment = VerticalAlignment.Stretch; outcastImage.HorizontalAlignment = HorizontalAlignment.Stretch;

            ///------------------------------
            outcastImage.ToolTip = result.Climate;

            animation.Duration = new System.Windows.Duration(TimeSpan.FromSeconds(animationTime));
            outcastImage.BeginAnimation(OpacityProperty, animation);
            outcastImage.BeginAnimation(OpacityProperty, animation);
        }