public static void Handle(Tenum key, bool?isChecked) { var m = new ButtonMessage <Tenum>(key); m.Checked = isChecked; MessageTube.Publish <ButtonMessage>(m); }
/// <summary> /// Button Click handlers would call this method, and Button CommandParameter /// is the string of an enum value /// </summary> public static void HandleButton(Object sender, RoutedEventArgs e) { Button bu = (Button)sender; //object x = bu.CommandParameter; // contains string var m = new ButtonMessage <Tenum>(Convert.ToString(bu.CommandParameter)); MessageTube.Publish <ButtonMessage>(m); }
public ExGrid() { InitializeComponent(); //this.Gridc.EnableOptionalGridControls = false; ButtonBus <ExMenuKey> .HookupSubscriber(this.HandleMenuCommand); MessageTube.Subscribe <FarewellMessage>(Farewell); Loaded += ExGrid_Loaded; }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { // but in OnClosed(), note that RestoreBounds is Empty base.OnClosing(e); try { SaveBounds(); MessageTube.Publish(new FarewellMessage()); FileInfo fi = LayoutFileInfo(); InvokeSavingPanelLayout(fi); } catch (Exception ex) { AbnakiLog.Exception(ex); } }
public MainMenu() { InitializeComponent(); MessageTube.Subscribe <FarewellMessage>(Farewell); }
public static void HookupSubscriber(Action <ButtonMessage <Tenum> > act) { MessageTube.Subscribe <ButtonMessage, ButtonMessage <Tenum> >(act); }