void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Menu = ((FirstFloor.ModernUI.Windows.Controls.ModernMenu)(target)); return; case 2: this.AddGroup = ((System.Windows.Controls.Button)(target)); return; case 3: this.AddLink = ((System.Windows.Controls.Button)(target)); return; case 4: this.RemoveGroup = ((System.Windows.Controls.Button)(target)); return; case 5: this.RemoveLink = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
public override void OnApplyTemplate() { base.OnApplyTemplate(); if (_frame != null) { _frame.Navigating -= OnFrameNavigating; _frame.Navigated -= OnFrameNavigated; } _frame = GetTemplateChild(@"ContentFrame") as ModernFrame; if (_frame != null) { _frame.Navigating += OnFrameNavigating; _frame.Navigated += OnFrameNavigated; } _menu = GetTemplateChild(@"PART_Menu") as ModernMenu; }
/// <summary> /// When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate(). /// </summary> public override void OnApplyTemplate() { base.OnApplyTemplate(); if (_frame != null) { _frame.Navigated -= Frame_Navigated; } _frame = GetTemplateChild("ContentFrame") as ModernFrame; if (_frame != null) { _frame.Navigated += Frame_Navigated; } _menu = GetTemplateChild("PART_Menu") as ModernMenu; }