public NewJumpTaskWindowViewModel() { Icons = new NamedIcon[] { new NamedIcon() { Caption = "Moon", Icon = ImageSourceHelper.GetImageSource(AssemblyHelper.GetResourceUri(typeof(NewJumpTaskWindowViewModel).Assembly, "Images/Moon.png")) }, new NamedIcon() { Caption = "Sun", Icon = ImageSourceHelper.GetImageSource(AssemblyHelper.GetResourceUri(typeof(NewJumpTaskWindowViewModel).Assembly, "Images/Sun.png")) } }; CustomCategory = ""; Title = "Title"; Description = ""; MessageText = "Message"; Icon = Icons.ElementAt(0); }
public TaskbarServicesViewModel() { OverlayIcons = new NamedIcon[] { new NamedIcon() { Caption = "Moon", Icon = ImageSourceHelper.GetImageSource(AssemblyHelper.GetResourceUri(typeof(TaskbarServices).Assembly, "Images/Moon.png")) }, new NamedIcon() { Caption = "Sun", Icon = ImageSourceHelper.GetImageSource(AssemblyHelper.GetResourceUri(typeof(TaskbarServices).Assembly, "Images/Sun.png")) } }; ProgressStatesNames = Enum.GetNames(typeof(TaskbarItemProgressState)); ButtonProperties = new ObservableCollection <bool> { true, true, true, false, true }; ButtonProperties.CollectionChanged += ButtonPropertyChanged; }
protected virtual void OnThumbButtonsCreateChanged() { if (ThumbButtonsCreate) { TaskbarButtonService.ThumbButtonInfos.Add(new TaskbarThumbButtonInfo { Description = "Zoom out", ImageSource = ImageSourceHelper.GetImageSource(AssemblyHelper.GetResourceUri(typeof(TaskbarServices).Assembly, "/Images/TaskbarScreenshots/ZoomOut_32x32.png")), Action = () => DecreaseThumbnailClipMarginMultipliyer() }); TaskbarButtonService.ThumbButtonInfos.Add(new TaskbarThumbButtonInfo { Description = "Zoom in", ImageSource = ImageSourceHelper.GetImageSource(AssemblyHelper.GetResourceUri(typeof(TaskbarServices).Assembly, "/Images/TaskbarScreenshots/ZoomIn_32x32.png")), Action = () => IncreaseThumbnailClipMarginMultipliyer() }); SetButtonsProperties(); } else { TaskbarButtonService.ThumbButtonInfos.Clear(); } }
public void SetIcon(string icon) { //一定要把image文件加入到工程中 Icon = ImageSourceHelper.GetImageSource(AssemblyHelper.GetResourceUri(typeof(ModuleMenu).Assembly, string.Format("Images/{0}", icon))); }