Exemplo n.º 1
0
        /// <summary/>
        public void ThawViewport()
        {
            VisualUtils.ThawVisuals(Viewport.Children);
            Viewport.Camera = Viewport.Camera.Clone();
            if (Viewport.Clip != null)
            {
                Viewport.Clip = Viewport.Clip.Clone();
            }
            if (Viewport.OpacityMask != null)
            {
                Viewport.OpacityMask = Viewport.OpacityMask.Clone();
            }
            if (Viewport.RenderTransform != null)
            {
                Viewport.RenderTransform = Viewport.RenderTransform.Clone();
            }
#pragma warning disable 0618
            if (Viewport.BitmapEffect != null)
            {
                Viewport.BitmapEffect = Viewport.BitmapEffect.Clone();
            }
            if (Viewport.BitmapEffectInput != null)
            {
                Viewport.BitmapEffectInput = Viewport.BitmapEffectInput.Clone();
            }
#pragma warning restore 0618
        }
Exemplo n.º 2
0
        void AssociatedObject_Click(object sender, RoutedEventArgs e)
        {
            TileViewControl tileControl = (TileViewControl)VisualUtils.FindAncestor(sender as System.Windows.Media.Visual, typeof(TileViewControl));
            TileViewItem    tileitem    = tileControl.ItemContainerGenerator.ContainerFromIndex(tileControl.SelectedIndex) as TileViewItem;

            tileitem.TileViewItemState = TileViewItemState.Normal;
        }
Exemplo n.º 3
0
        /// <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;
            System.Threading.Thread.CurrentThread.CurrentUICulture = DemoBrowserViewModel.AppCulture;
            RichTextBoxAdvLocalizationResourceAccessor.Instance.SetResources(null, string.Empty);
            RichTextRibbonLocalizationResourceAccessor.Instance.SetResources(null, string.Empty);
            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);
        }
Exemplo n.º 4
0
        void ReportEditer_Loaded(object sender, RoutedEventArgs e)
        {
            this.ReportDesignerControl.EnableMDIDesigner = false;
            this.ReportDesignerControl.AllReportsClosed += new AllReportsClosedEventHandler(ReportDesignerControl_AllReportsClosed);
            this.ReportDesignerControl.ShowReportData    = this.ShowReportData;
            this.ReportDesignerControl.ShowRibbon        = this.ShowRibbon;

            this.ReportDesignerControl.ShowProperties      = this.ShowProperties;
            this.ReportDesignerControl.ShowRuler           = this.ShowRuler;
            this.ReportDesignerControl.ShowApplicationMenu = false;
            this.ReportDesignerControl.OpenReport(this.ReportPath);
            this.Closed += new EventHandler(ReportEditer_Closed);

            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);
            }
        }
Exemplo n.º 5
0
        /// <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);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Calle when [unloaded].
        /// </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 OnUnloaded(object sender, RoutedEventArgs e)
        {
            this.Unloaded -= OnUnloaded;
            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(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;
            }
        }
        /// <summary>
        /// On Visual Style Changed.
        /// </summary>
        /// <remarks></remarks>
        private void OnVisualStyleChanged()
        {
            // Unhooks 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;
            }
            VisualStyles visualStyle = VisualStyles.Default;

            Enum.TryParse(CurrentVisualStyle, out visualStyle);
            string path = "pack://application:,,/Assets/Syncfusion.png";

            if (visualStyle == VisualStyles.Blend || visualStyle == VisualStyles.Office2010Black ||
                visualStyle == VisualStyles.Office2010Blue || visualStyle == VisualStyles.VisualStudio2013)
            {
                path = "pack://application:,,/Assets/SyncfusionWhite.png";
            }
            ImageSourceConverter imgConv     = new ImageSourceConverter();
            ImageSource          imageSource = (ImageSource)imgConv.ConvertFromString(path);

            this.Office2010Icon = imageSource;
            if (visualStyle != VisualStyles.Default)
            {
                SfSkinManager.ApplyStylesOnApplication = true;
                SfSkinManager.SetVisualStyle(this, visualStyle);
                SfSkinManager.ApplyStylesOnApplication = false;
            }
        }
Exemplo n.º 8
0
    private void Explode()
    {
        VisualUtils.AddExplosion(this.transform.position);

        GetComponentInChildren <ParticleSystem>().transform.SetParent(null);

        GameObject.Destroy(this.gameObject);
    }
Exemplo n.º 9
0
 public TileViewItem GetTileItem()
 {
     if (tileItems == null)
     {
         tileItems = VisualUtils.FindAncestor(this.Target, typeof(TileViewItem)) as TileViewItem;
     }
     return(tileItems);
 }
        private void PropertyGrid_Loaded(object sender, RoutedEventArgs e)
        {
            var item1 = VisualUtils.FindDescendant(this, typeof(PropertyView)) as PropertyView;

            if (item1 != null)
            {
                item1.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
            }
        }
Exemplo n.º 11
0
    private void Shoot(Vector3 dir)
    {
        GameController.Instance.OnPlayerSetVisible(true);

        GameController.Instance.OnPlayerBoost(dir, 1.5f);

        VisualUtils.AddExplosion(this.transform.position);
        GameController.Instance.PlaySound(GameSettings.Instance.AudioSettings.Explosion);
    }
Exemplo n.º 12
0
 public void PropertyChangedHandler(object param)
 {
     if (param != null)
     {
         Border    border = param as Border;
         TextBlock txt    = VisualUtils.FindDescendant(border, typeof(TextBlock)) as TextBlock;
         EventLog.Add("Selection Changed : " + txt.Text);
     }
 }
Exemplo n.º 13
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var dockcontrol = VisualUtils.FindDescendant(this, typeof(DockingManager)) as DockingManager;

            if (dockcontrol != null)
            {
                _options.MainSettings.BackGround = new BrushConverter().ConvertToString(dockcontrol.Background);
            }
        }
Exemplo n.º 14
0
    private void Jump(Vector3 dir, float magnitude = 1f)
    {
        //transform.rotation = Quaternion.AngleAxis(_rb.velocity.x * 5f, Vector3.forward);

        _rb.velocity = Vector2.zero;
        _rb.AddForce(dir * _settings.JumpHeight * magnitude, ForceMode2D.Impulse);

        VisualUtils.AddDarkHit(new Vector3(this.transform.position.x, this.transform.position.y, -1f));
    }
Exemplo n.º 15
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        // If we've collided with the player then fire an event to let the player know! Also let's take away some health for the enemy
        if (collider.tag == "Player")
        {
            _isAlive = false;

            float damageValue = 1f - (float)(_settingsModified.Health - 1) / (float)_settings.Health;
            float boost       = Mathf.Lerp(0.5f, 1f, damageValue);

            _rb.gravityScale = 0.75f;

            Vector2 vel = GameController.Instance.Player.GetVelocity();
            vel.x *= 1.25f;
            vel.y  = GameSettings.Instance.DamageSettings.Boost * 0.5f;

            _rb.velocity = Vector2.zero;
            _rb.AddForce(vel, ForceMode2D.Impulse);

            _sprite.SetSprite("Bird_Dead");

            VisualUtils.AddHit(this.transform.position);

            GameController.Instance.PlaySound(GameSettings.Instance.AudioSettings.Smash, 1f, damageValue + 1f);



            if (--_settingsModified.Health <= 0)
            {
                Explode();
                GameController.Instance.PlaySound(GameSettings.Instance.AudioSettings.Death);

                GameController.Instance.OnPlayerBoost(Vector3.up, boost * 1.25f);
            }
            else
            {
                _sprite.color = Color.Lerp(Color.white, Color.red, damageValue);
                GameController.Instance.Camera.Screenshake(0.25f, 0.5f);

                GameController.Instance.OnPlayerBoost(Vector3.up, boost);

                // On the first hit let's stop bird's flying animation
                _sprite.GetComponent <tk2dSpriteAnimator>().Stop();

                // Also let's add goggles
                GameObject  go            = GameObject.Instantiate(GameSettings.Instance.Prefabs.Bone, this.transform.position, Quaternion.AngleAxis(Random.value * 360f, Vector3.forward)) as GameObject;
                Rigidbody2D boneRigidbody = go.GetComponent <Rigidbody2D>();

                Vector2 explodeVel = new Vector2(Random.Range(-5f, 5f), 10f);
                boneRigidbody.AddForce(explodeVel, ForceMode2D.Impulse);

                boneRigidbody.angularVelocity = 0.0f;
                boneRigidbody.AddTorque(-boneRigidbody.velocity.x * 0.5f, ForceMode2D.Impulse);
            }
        }
    }
 public void RemoveGroupBarOverFlowButton()
 {
     foreach (ToggleButton item in VisualUtils.EnumChildrenOfType(groupBar, typeof(ToggleButton)))
     {
         if (item.Name == "PART_OverFlowButton")
         {
             item.Visibility = Visibility.Collapsed;
         }
     }
 }
Exemplo n.º 17
0
    private IEnumerator BlockPlayerInputBitLonger_Coroutine()
    {
        yield return(new WaitForSeconds(0.5f));

        GameController.Instance.OnPlayerInputBlocked(false);

        VisualUtils.AddExplosion(this.transform.position);

        GameObject.Destroy(this.gameObject);

        _isPlayerInside = false;
    }
Exemplo n.º 18
0
 protected override void OnInitialized(EventArgs e)
 {
     base.OnInitialized(e);
     Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() =>
     {
         var presenter = VisualUtils.GetVisualChild <ContentPresenter>(this);
         _yesButton    = ContentTemplate?.FindName("PART_YesButton", presenter) as Button;
         _noButton     = ContentTemplate?.FindName("PART_NoButton", presenter) as Button;
         _okButton     = ContentTemplate?.FindName("PART_OKButton", presenter) as Button;
         _cancelButton = ContentTemplate?.FindName("PART_CancelButton", presenter) as Button;
         UpdateState();
     }));
 }
Exemplo n.º 19
0
    // When the player is inside the barrel we can tap anywhere on the screen to shoot
    private void TouchBegan(Vector2 touchPosition)
    {
        if (_isPlayerInside && _isShooting == false)
        {
            _isShooting = true;

            // Add an explosion just slightly forward of the barrel's direction
            Vector3 pos = this.transform.position + this.transform.up * 1.25f;
            pos.z = -1f;
            VisualUtils.AddFireExplosion(pos);
            GameController.Instance.PlaySound(GameSettings.Instance.AudioSettings.Explosion);
        }
    }
Exemplo n.º 20
0
        void tiletimer_Tick(object sender, EventArgs e)
        {
            if (GetTileItem() != null && GetTileItem().TileViewItemState == TileViewItemState.Normal)
            {
                Storyboard storyboard = null;
                if (!slide)
                {
                    foreach (Window win in Application.Current.Windows)
                    {
                        if (win is ProductDemosWindow)
                        {
                            DataBindingDemo demo = VisualUtils.FindDescendant(win as System.Windows.Media.Visual, typeof(DataBindingDemo)) as DataBindingDemo;
                            if (demo != null)
                            {
                                storyboard = demo.Resources["Storyboard1"] as Storyboard;
                            }
                            slide = false;
                            break;
                        }
                    }
                }
                else
                {
                    foreach (Window win in Application.Current.Windows)
                    {
                        if (win is ProductDemosWindow)
                        {
                            DataBindingDemo demo = VisualUtils.FindDescendant(win as System.Windows.Media.Visual, typeof(DataBindingDemo)) as DataBindingDemo;
                            if (demo != null)
                            {
                                storyboard = demo.Resources["Storyboard2"] as Storyboard;
                            }
                            slide = false;
                            break;
                        }
                    }
                }
                try
                {
                    if (TargetObject is TileItemView && storyboard != null)
                    {
                        storyboard.Begin((TileItemView)TargetObject);
                    }
                }
                catch (Exception)
                {
                }

                tiletimer.Interval = new TimeSpan(0, 0, rndm.Next(3, 10));
            }
        }
Exemplo n.º 21
0
        private void ComboBoxAdv_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBoxItemAdv item;
            MainWindow      samplewindow = VisualUtils.FindAncestor((Visual)this, typeof(MainWindow)) as MainWindow;
            ComboBoxAdv     combo        = sender as ComboBoxAdv;

            if (combo != null && samplewindow != null)
            {
                if (combo.SelectedItem != null)
                {
                    item = combo.SelectedItem as ComboBoxItemAdv;
                    SkinStorage.SetVisualStyle(samplewindow, item.Content.ToString());
                }
            }
        }
Exemplo n.º 22
0
        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);
            }
        }
 private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
 {
     foreach (PropertyCatagoryViewItem item in VisualUtils.EnumChildrenOfType(this, typeof(PropertyCatagoryViewItem)))
     {
         foreach (var items in item.Items)
         {
             foreach (PropertyViewItem propertyViewItem in VisualUtils.EnumChildrenOfType(this, typeof(PropertyViewItem)))
             {
                 var button = (ToggleButton)propertyViewItem.Template.FindName("ToggleButton", propertyViewItem);
                 if (button.Visibility == System.Windows.Visibility.Visible && !button.IsMouseOver)
                 {
                     button.IsChecked = true;
                 }
             }
         }
     }
 }
Exemplo n.º 24
0
 /// <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();
        }
Exemplo n.º 26
0
        internal static TextBlock GetEditableTextBlock(TreeViewItemAdv item)
        {
            if (item != null)
            {
                TextBlock oobj = null;

                if (oobj == null)
                {
                    oobj = VisualUtils.FindDescendant(item.Template.FindName("PART_Header", item) as ContentPresenter, typeof(TextBlock)) as TextBlock;
                }

                return(oobj);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 27
0
        private void bt_Run_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (HasSelectedAlgorithm)
                {
                    string _Error = "";
                    if (!Enviroment.CanRunAlgorithm(out _Error, AlgorithmType.Clustering))
                    {
                        MessageBox.Show(_Error, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                        return;
                    }
                    ReflectionTools  _rct        = new ReflectionTools();
                    ClusterAlgorithm _ClusterAlg = ReflectionTools.GetInstance <ClusterAlgorithm>(Tree.Value.FullName);

                    foreach (CEDS.Property _p in Tree.Value.InProperties)
                    {
                        _rct.SetProperty(Tree.Value.FullName, _ClusterAlg, _p);
                    }


                    if (!VisualUtils.SetGlobalInProperties(_rct, _ClusterAlg, Tree, out _Error, this.chbx_AttrRnd.IsChecked.Value))
                    {
                        MessageBox.Show(_Error, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                        return;
                    }

                    Run _run = RunMethod;

                    _run.BeginInvoke(_ClusterAlg, RunFinish, new DataThread()
                    {
                        Run = _run, ClusterAlgorithm = _ClusterAlg
                    });
                }
                else
                {
                    MessageBox.Show("You must first select a Clustering algorithm.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
            catch (Exception _ex)
            {
                GeneralTools.Tools.WriteToLog(_ex);
            }
        }
Exemplo n.º 28
0
        void DocumentContainer1_Loaded(object sender, RoutedEventArgs e)
        {
            TabPanelAdv tabpanel = VisualUtils.FindDescendant(sender as Visual, typeof(TabPanelAdv)) as TabPanelAdv;

            if (tabpanel != null)
            {
                Button prevbutton = tabpanel.Template.FindName("PART_PrevTab", tabpanel) as Button;
                Button nextbutton = tabpanel.Template.FindName("PART_NextTab", tabpanel) as Button;
                if (prevbutton != null)
                {
                    ToolTipService.SetShowOnDisabled(prevbutton, true);
                    prevbutton.ToolTip = "Previous";
                }
                if (nextbutton != null)
                {
                    ToolTipService.SetShowOnDisabled(nextbutton, true);
                    nextbutton.ToolTip = "Next";
                }
            }
        }
Exemplo n.º 29
0
        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);
            }
        }
Exemplo n.º 30
0
        void DocumentContainer1_Loaded(object sender, RoutedEventArgs e)
        {
            TabPanelAdv tabpanel = VisualUtils.FindDescendant(sender as Visual, typeof(TabPanelAdv)) as TabPanelAdv;

            if (tabpanel != null)
            {
                ToggleButton menubutton  = tabpanel.Template.FindName("PART_MenuButton", tabpanel) as ToggleButton;
                ToggleButton closebutton = tabpanel.Template.FindName("PART_CloseButton", tabpanel) as ToggleButton;
                if (menubutton != null)
                {
                    ToolTipService.SetShowOnDisabled(menubutton, true);
                    menubutton.ToolTip = "Context Menu";
                }
                if (closebutton != null)
                {
                    ToolTipService.SetShowOnDisabled(closebutton, true);
                    closebutton.ToolTip = "Close";
                }
            }
        }