////shows context menu for program item /// <summary> /// </summary> /// <param name="location"></param> /// <param name="fileDescr"></param> private void ShowPopupMenu(Point location, FileDescr fileDescr) { var mainMenu = new ContextMenu(); var menuPinProgram = new MenuItem { Text = _str_pinToStart.Localize() }; menuPinProgram.Click += (s, e) => PinProgram(fileDescr); mainMenu.MenuItems.Add(menuPinProgram); if (ParentControl != null) mainMenu.Show(ParentControl, location); }
/// <summary> /// pin selected item to start menu /// </summary> /// <param name="fileDescr"></param> private void PinProgram(FileDescr fileDescr) { var messenger = TinyIoCContainer.Current.Resolve<ITinyMessengerHub>(); messenger.Publish(new PinProgramMessage { Name = fileDescr.Name, Path = fileDescr.Path} ); }