/// <inheritdoc/> public void FireOnItemSelected(ItemRowViewModel selectedItem) { var e = new SelectedItemEventArgs(); e.SelectedItem = selectedItem; OnSelectedItem?.Invoke(this, e); }
public static FrameworksPopover Init(Rect position, OnSelectedItem selectedItemCallback, Styling style, BuildPlatform platform) { var win = EditorWindow.CreateInstance <FrameworksPopover>(); win.Configure(position, selectedItemCallback, style, platform); return(win); }
void Configure(Rect popoverPosition, string popoverTitle, string[] content, OnSelectedItem selectedItemCallback, Styling style, bool allowCustomEntry, string initialString) { var size = new Vector2(popoverPosition.width, popoverPosition.height); popoverPosition.width = popoverPosition.height = 0; _content = content; _filtered = content; _searchString = initialString; _onSelectedItem = selectedItemCallback; _allowCustomEntry = allowCustomEntry; _title = popoverTitle; _style = style; UpdateFilteredList(); ShowAsDropDown(popoverPosition, size); }
public static BuildSettingSelectionPopover Init(Rect position, Mode mode, string[] existingSettings, OnSelectedItem selectedItemCallback, Styling style, string initialString = "") { var win = EditorWindow.CreateInstance <BuildSettingSelectionPopover>(); var size = new Vector2(position.width, position.height); position.width = position.height = 0; win.ShowAsDropDown(position, size); win.Configure(mode, existingSettings, selectedItemCallback, style, initialString); return(win); }
private void SuggestedRepeaterItemSelected(object selectedItem) { MainEntry.Text = GetSelectedText(selectedItem); MainEntry.TextColor = TextColor; ShowHideListbox(false); _availableSuggestions.Clear(); SelectedItem = selectedItem; SelectedItemCommand?.Execute(selectedItem); MainEntry.Text = string.Empty; OnSelectedItem?.Invoke(this, new EventArgs()); }
private void ItemImageControl_OnMouseDown(object sender, MouseButtonEventArgs e) { OnItemClick?.Invoke(null, int.Parse(NumIndex)); if (blSelectedflag) { blSelectedflag = false; GridMain.Background = new SolidColorBrush(Colors.DarkOrange); } else { GridMain.Background = new SolidColorBrush(Colors.LightGray); blSelectedflag = true; OnSelectedItem?.Invoke(null, this); } }
void Configure(Mode mode, string[] existingSettings, OnSelectedItem selectedItemCallback, Styling style, string initialString = "") { _style = style; _existingSettings = new List <string>(existingSettings); //exclude settings we have already added var settings = XcodeBuildSettings.Instance().BuildSettings.Where(o => !existingSettings.Contains(o.BuildSettingName)).ToList(); foreach (var s in settings) { Dictionary <string, string> dic; if (!_availableSettings.TryGetValue(s.Group, out dic)) { dic = new Dictionary <string, string>(); _availableSettings[s.Group] = dic; } dic[s.BuildSettingName] = s.DisplayName; _groupFoldoutStates[s.Group] = true; } _searchString = initialString; _onSelectedItem = selectedItemCallback; if (mode == Mode.Add) { _title = "Add Build Setting"; } else { _title = "Edit Build Setting"; } UpdateFilteredList(); }
void Configure(Rect popoverPosition, OnSelectedItem selectedItemCallback, Styling style, BuildPlatform platform) { _xcodeFinder = new XcodeSDKFinder(platform); var minWidth = style.MaxLabelWidth(_xcodeFinder.FrameworkNames, popoverPosition.width) + 40; var width = popoverPosition.width; _platform = platform; if (minWidth > popoverPosition.width) { width = Mathf.Max(minWidth, popoverPosition.width); float delta = (minWidth - popoverPosition.width) * 0.5f; popoverPosition.x -= delta; } var size = new Vector2(width, popoverPosition.height); popoverPosition.width = popoverPosition.height = 0; _onSelectedItem = selectedItemCallback; _style = style; ShowAsDropDown(popoverPosition, size); }
public void LevelUP() { Debug.Log("Покупаем стулл"); if (levels.Length > level + 1) { if (ShopManager.Money >= levels[level + 1].price) { if (ChooseSystem.RData.TryShelfLevelUp()) { ShopManager.Money -= levels[level + 1].price; level++; ChangeModel(level); ChooseSystem.RData.ShelfLevelUp(); OnSelectedItem?.Invoke(this); } else { Debug.LogAssertion("ERROR : Не удалось проверить уровень стула"); OnUpdateFailed?.Invoke(this); } } } }
private void RaiseItemSelection() { // Here we have a custom implementation of INotification which allows us to pass custom data in the // parameter of the interaction request. In this case, we are passing a list of items. IEnumerable sourceList = DataSource as IEnumerable; ItemSelectionNotification notification = new ItemSelectionNotification(sourceList); notification.Title = Title; notification.AssistProperites = AssistProperties; // The custom popup view in this case has its own view model which implements the IInteractionRequestAware interface // therefore, its Notification property will be automatically populated with this notification by the PopupWindowAction. // Like this that view model is able to recieve data from this one without knowing each other. // this.InteractionResultMessage = ""; this.ItemSelectionRequest.Raise(notification, returned => { if (returned != null && returned.Confirmed && returned.SelectedItem != null) { this.InteractionResultMessage = returned.SelectedItem; if (OnSelectedItem != null) { OnSelectedItem.Invoke(SelectionState.OK, returned.SelectedItem); } } else { if (OnSelectedItem != null) { OnSelectedItem.Invoke(SelectionState.Cancel, returned.SelectedItem); } } }); }
public void Init(ItemOption item, OnSelectedItem onSelectedCallback) { Id = item.Value; Text.text = item.Text; OnSelectedItemCallback = onSelectedCallback; }
public static ListSelectionPopover Init(Rect position, string title, string[] content, OnSelectedItem selectedItemCallback, Styling style, bool allowCustomEntry = false, string initialString = "") { var win = EditorWindow.CreateInstance <ListSelectionPopover>(); win.Configure(position, title, content, selectedItemCallback, style, allowCustomEntry, initialString); return(win); }
private void Item_OnSelectedItem(object sender, ItemImageControl e) { _item = e; _selectModel = e.GetCurrentData(); OnSelectedItem?.Invoke(this, e); }
public void Init(List <string> options, OnSelectedItem onSelectedItemCallback) { OnSelectedItemCallback = onSelectedItemCallback; InitItemOptions(options); InitList(); }