/// <summary> /// Raises the Closing event. /// </summary> /// <param name="e">CancelEventArgs that contains the event dat</param> protected override void OnClosing(CancelEventArgs e) { this.Loaded -= OnLoaded; if (richTextRibbon != null) { richTextRibbon.Dispose(); richTextRibbon = null; } if (richTextBoxAdv != null) { richTextBoxAdv.SelectionChanged -= RichTextBoxAdv_SelectionChanged; richTextBoxAdv.RequestNavigate -= RichTextBoxAdv_RequestNavigate; richTextBoxAdv.Dispose(); richTextBoxAdv = null; } WindowTitleBarButton HelpButton = null; Syncfusion.Windows.Tools.Controls.TitleBar titleBar = VisualUtils.FindDescendant(this as RibbonWindow, typeof(Syncfusion.Windows.Tools.Controls.TitleBar)) as Syncfusion.Windows.Tools.Controls.TitleBar; if (titleBar != null) { HelpButton = titleBar.Template.FindName("HelpButton", titleBar) as WindowTitleBarButton; } if (HelpButton != null) { HelpButton.Click -= HelpButton_Click; } base.OnClosing(e); }
private void RibbonMainWindow_Loaded(object sender, RoutedEventArgs e) { WindowTitleBarButton HelpButton = null; Syncfusion.Windows.Tools.Controls.TitleBar _titlebar = VisualUtils.FindDescendant(this as RibbonWindow, typeof(Syncfusion.Windows.Tools.Controls.TitleBar)) as Syncfusion.Windows.Tools.Controls.TitleBar; if (_titlebar != null) { HelpButton = _titlebar.Template.FindName("HelpButton", _titlebar) as WindowTitleBarButton; } if (HelpButton != null) { HelpButton.Click += new RoutedEventHandler(HelpButton_Click); } }
/// <summary> /// Called when [loaded]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private void OnLoaded(object sender, RoutedEventArgs e) { if (richTextBoxAdv != null) { richTextBoxAdv.Selection.Select(richTextBoxAdv.Document.DocumentStart, richTextBoxAdv.Document.DocumentStart); richTextBoxAdv.Focus(); } WindowTitleBarButton HelpButton = null; Syncfusion.Windows.Tools.Controls.TitleBar titleBar = VisualUtils.FindDescendant(sender as RibbonWindow, typeof(Syncfusion.Windows.Tools.Controls.TitleBar)) as Syncfusion.Windows.Tools.Controls.TitleBar; if (titleBar != null) HelpButton = titleBar.Template.FindName("HelpButton", titleBar) as WindowTitleBarButton; if (HelpButton != null) { HelpButton.Click += HelpButton_Click; HelpButton.ToolTip = "Help"; } }
/// <summary> /// Called on rich text ribbon loaded. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An <see cref="T:System.Windows.RoutedEventArgs">RoutedEventArgs</see> that contains the event data.</param> /// <remarks></remarks> private void RichTextRibbon_Loaded(object sender, RoutedEventArgs e) { // Hooks the event handler for RibbonWindow title bar help button. Syncfusion.Windows.Tools.Controls.TitleBar titleBar = VisualUtils.FindDescendant(this, typeof(Syncfusion.Windows.Tools.Controls.TitleBar)) as Syncfusion.Windows.Tools.Controls.TitleBar; WindowTitleBarButton HelpButton = null; if (titleBar != null) { HelpButton = titleBar.Template.FindName("HelpButton", titleBar) as WindowTitleBarButton; } if (HelpButton != null) { HelpButton.Click += HelpButton_Click; HelpButton.ToolTip = "Help"; } // Initializes the skin tab. InitializeSkinTab(); }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { this.ReportDesignerControl.EnableMDIDesigner = false; string path = @"../../../ReportTemplate/Sales Dashboard.rdl"; this.ReportDesignerControl.OpenReport(path); WindowTitleBarButton HelpButton = null; Syncfusion.Windows.Tools.Controls.TitleBar _titlebar = VisualUtils.FindDescendant(this as RibbonWindow, typeof(Syncfusion.Windows.Tools.Controls.TitleBar)) as Syncfusion.Windows.Tools.Controls.TitleBar; if (_titlebar != null) { HelpButton = _titlebar.Template.FindName("HelpButton", _titlebar) as WindowTitleBarButton; } if (HelpButton != null) { HelpButton.Click += new RoutedEventHandler(HelpButton_Click); } }