本文整理汇总了C#中System.Windows.Media.Imaging.BitmapImage.set_UriSource方法的典型用法代码示例。如果您正苦于以下问题:C# BitmapImage.set_UriSource方法的具体用法?C# BitmapImage.set_UriSource怎么用?C# BitmapImage.set_UriSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Imaging.BitmapImage
的用法示例。
在下文中一共展示了BitmapImage.set_UriSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Convert
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
{
return null;
}
BitmapImage image = new BitmapImage();
switch (((QualityFace) value))
{
case QualityFace.NoData:
return null;
case QualityFace.Happy:
image.set_UriSource(new Uri("/BEPB;component/Images/Popup/HappyFace.png", UriKind.Relative));
return image;
case QualityFace.Normal:
image.set_UriSource(new Uri("/BEPB;component/Images/Popup/NormalFace.png", UriKind.Relative));
return image;
case QualityFace.Sad:
image.set_UriSource(new Uri("/BEPB;component/Images/Popup/SadFace.png", UriKind.Relative));
return image;
}
return image;
}
示例2: Image_MouseLeftButtonDown
private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Image image = sender as Image;
if (image != null)
{
if ((!string.IsNullOrEmpty(this.CurrentChannelName) && (this.CurrentChannelName != image.get_Name())) && ((image.get_Name() != "Support") && (image.get_Name() != "Mobile")))
{
BitmapImage image2 = new BitmapImage();
string currentChannelName = this.CurrentChannelName;
if (currentChannelName != null)
{
if (!(currentChannelName == "Actually"))
{
if (currentChannelName == "Quality")
{
image2.set_UriSource(new Uri("/BEPB;component/Images/AQI.png", UriKind.Relative));
this.Quality.set_Source(image2);
}
else if (currentChannelName == "Forecast")
{
image2.set_UriSource(new Uri("/BEPB;component/Images/fqyb.png", UriKind.Relative));
this.Forecast.set_Source(image2);
}
}
else
{
image2.set_UriSource(new Uri("/BEPB;component/Images/ssnd.png", UriKind.Relative));
this.Actually.set_Source(image2);
}
}
this.CurrentChannelName = image.get_Name();
}
if (this.LastStation != null)
{
this.LastStation.IsFocused = false;
}
string str2 = image.get_Name();
if (str2 != null)
{
if (!(str2 == "Actually"))
{
if (!(str2 == "Quality"))
{
if (!(str2 == "Forecast"))
{
if (!(str2 == "Support"))
{
if (str2 == "Mobile")
{
HtmlPage.get_Window().Navigate(new Uri("http://www.bjmemc.com.cn/g377.aspx", UriKind.Absolute), "_blank");
}
return;
}
HtmlPage.get_Window().Navigate(new Uri("http://www.bjmemc.com.cn/g370.aspx", UriKind.Absolute), "_blank");
return;
}
this.DayForecastPanel.set_Visibility(0);
this.ActuallyFrame.set_Visibility(1);
this.AirQualityFrame.set_Visibility(1);
this.bsMapMode.ZoomHome(true);
this.bsMapMode.bCanZoom = false;
this.airDataContext.bCanZoomIn = false;
this.airDataContext.bCanZoomOut = false;
this.NavigationCtrl.bCanZoom = false;
this.Five.set_Visibility(0);
this.Districts.set_Visibility(1);
this.MapStations.set_Visibility(1);
this.p_bottom_aqiGrid.set_Visibility(1);
this.wrwtlGrid.set_Visibility(1);
return;
}
}
else
{
this.DayForecastPanel.set_Visibility(1);
this.ActuallyFrame.set_Visibility(0);
this.AirQualityFrame.set_Visibility(1);
this.bsMapMode.bCanZoom = true;
this.airDataContext.bCanZoomIn = this.bsMapMode.bCanZoomIn;
this.airDataContext.bCanZoomOut = this.bsMapMode.bCanZoomOut;
this.NavigationCtrl.bCanZoom = true;
this.wrwButtonsBorder.set_Visibility(0);
if (this.WRWChannelClicked == 0)
{
this.WRWChannelClicked = 1;
}
if ((this.WRWChannelClicked == 1) && this.bWRWDataLoaded)
{
this.wrw_pm25.set_Visibility(0);
(this.wrwButtons.get_Resources().get_Item("PM25Storyboard") as Storyboard).Begin();
this.WRWChannelClicked = -1;
}
foreach (StationData data in (Application.get_Current() as App).StationsList)
{
StationPushpin station = this.GetStation(data.Station);
if (station != null)
{
station.set_Background(data.WRWBackColor);
station.DataVisibility = data.WRWDataVisibility;
}
//.........这里部分代码省略.........
示例3: Image_MouseLeave
private void Image_MouseLeave(object sender, MouseEventArgs e)
{
Image image = sender as Image;
if ((image != null) && (string.IsNullOrEmpty(this.CurrentChannelName) || (this.CurrentChannelName != image.get_Name())))
{
BitmapImage image2 = new BitmapImage();
string str = image.get_Name();
if (str != null)
{
if (!(str == "Actually"))
{
if (str == "Quality")
{
image2.set_UriSource(new Uri("/BEPB;component/Images/AQI.png", UriKind.Relative));
}
else if (str == "Forecast")
{
image2.set_UriSource(new Uri("/BEPB;component/Images/fqyb.png", UriKind.Relative));
}
else if (str == "Support")
{
image2.set_UriSource(new Uri("/BEPB;component/Images/fwzc.png", UriKind.Relative));
}
else if (str == "Mobile")
{
image2.set_UriSource(new Uri("/BEPB;component/Images/sjb.png", UriKind.Relative));
}
}
else
{
image2.set_UriSource(new Uri("/BEPB;component/Images/ssnd.png", UriKind.Relative));
}
}
image.set_Source(image2);
}
}