protected override void OnDeactivated() { Window.TemplateChanged -= new EventHandler(window_TemplateChanged); UnsubscribeFromContainerEvents(); navigationActionContainer = null; base.OnDeactivated(); }
private void NavigationActionContainer_Unload(object sender, EventArgs e) { NavigationActionContainer navigationActionContainer = (NavigationActionContainer)sender; navigationActionContainer.Unload -= new EventHandler(NavigationActionContainer_Unload); OnControlInitialized(navigationActionContainer); }
private void NavigationActionContainer_Init(object sender, EventArgs e) { NavigationActionContainer navigationActionContainer = (NavigationActionContainer)sender; navigationActionContainer.Init -= new EventHandler(NavigationActionContainer_Init); ReadValue(); }
protected void SetupNavigationControl(NavigationActionContainer navigationActionContainer) { var navBar = navigationActionContainer.NavigationControl as NavBarNavigationControl; if (navBar != null) { navBar.ActiveGroupChanged += navBar_ActiveGroupChanged; navBar.Click += navBar_Click; } }
private void Frame_TemplateChanged(object sender, EventArgs e) { NavigationActionContainer result = FindNavigationActionContainer(); if (result != null) { SetupNavigationControl(result); } }
void Window_ProcessActionContainer(object sender, ProcessActionContainerEventArgs e) { UnsubscribeFromContainerEvents(); if (e.ActionContainer is NavigationActionContainer) { navActionContainer = e.ActionContainer as NavigationActionContainer; SubscribeToContainerEvents(); SetupNavBar(); } }
protected override void OnDeactivated() { Window.ProcessActionContainer -= Window_ProcessActionContainer; UnsubscribeFromContainerEvents(); navActionContainer = null; base.OnDeactivated(); // Unsubscribe from previously subscribed events and release other references and resources. base.OnDeactivated(); }
protected override object CreateControlCore() { NavigationActionContainer navigationActionContainer = new NavigationActionContainer(); navigationActionContainer.DisableDelayedCreation(); navigationActionContainer.RecoverViewStateOnNavigationCallback = true; navigationActionContainer.ContainerId = "TestNavigation"; navigationActionContainer.Init += new EventHandler(NavigationActionContainer_Init); navigationActionContainer.Load += new EventHandler(NavigationActionContainer_Load); navigationActionContainer.Unload += new EventHandler(NavigationActionContainer_Unload); return(navigationActionContainer); }
private void NavigationActionContainer_Load(object sender, EventArgs e) { NavigationActionContainer navigationActionContainer = (NavigationActionContainer)sender; navigationActionContainer.Load -= new EventHandler(NavigationActionContainer_Load); ICallbackManagerHolder holder = navigationActionContainer.Page as ICallbackManagerHolder; if (holder != null) { holder.CallbackManager.RegisterHandler(NavigationActionContainer.XafNavigationHandlerId, navigationActionContainer); } }
protected override IActionContainer FindNavigationActionContainer() { foreach (IActionContainer actionContainer in Window.Template.GetContainers()) { NavigationActionContainer result = actionContainer as NavigationActionContainer; if (result != null) { return(result); } } return(null); }
protected override void OnDeactivated() { Window.ProcessActionContainer -= Window_ProcessActionContainer; UnsubscribeFromContainerEvents(); navActionContainer = null; if (this.searchPanel != null) { searchPanel.Dispose(); } base.OnDeactivated(); }
protected override void SetupNavigationControl(IActionContainer container) { NavigationActionContainer navigationActionContainer = (NavigationActionContainer)container; NavBarNavigationControl navBar = navigationActionContainer.NavigationControl as NavBarNavigationControl; if (navBar != null) { navBar.ActiveGroupChanged += navBar_ActiveGroupChanged; } TreeListNavigationControl treeList = navigationActionContainer.NavigationControl as TreeListNavigationControl; if (treeList != null) { treeList.FocusedNodeChanged += treeList_FocusedNodeChanged; } }
private void window_TemplateChanged(object sender, EventArgs e) { if (Window.Template != null) { UnsubscribeFromContainerEvents(); foreach (object actionContainer in Window.Template.GetContainers()) { navigationActionContainer = actionContainer as NavigationActionContainer; if (navigationActionContainer != null) { SubscribeToContainerEvents(); SetupNavBar(); break; } } } }
protected override void ReadValueCore() { NavigationActionContainer.Register((SingleChoiceAction)PropertyValue, NavigationObject.NavigationStyle); }