protected virtual void OnToolbarItemSelected(EventArgs e) { if (ToolbarItemSelected != null) { foreach (IToolbarItemViewExtension ve in ToolbarExtensionManager.Instance.Extensions) { IToolbarItemViewModelExtension radioButtonVM = ve.ViewModel; if (radioButtonVM.Name.EndsWith("_LAYOUT") && radioButtonVM != this) { Type radioButtonType = radioButtonVM.GetType(); PropertyInfo isCheckedProp = radioButtonType.GetProperty("IsChecked"); isCheckedProp.SetValue(radioButtonVM, false, null); } } ToolbarItemSelected(this, e); } }
/// <summary> /// Creates a new instance of the Berico.SnagL.Events. /// ToolBarItemEventArgs class using the provided /// IToolbarItemViewModelExtension /// </summary> /// <param name="_toolbarItem">The toolbar item involved in the event</param> public ToolBarItemEventArgs(IToolbarItemViewModelExtension _toolbarItem, string _scope) { ToolBarItem = _toolbarItem; Scope = _scope; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ViewModel_ToolbarItemSelected(object sender, EventArgs e) { IToolbarItemViewModelExtension toolbarItem = sender as IToolbarItemViewModelExtension; OnToolBarItemClicked(new ToolBarItemEventArgs(toolbarItem, this.scope)); }