public void LoadFrame(IGnosisFrameImplementation frameImplementation, IGnosisToggleButtonImplementation _headerButton)
        {
            // gridContent.Children.Clear();
            //if (headerButton != null && pnlHeader.Children.Contains(headerButton))
            //{
            //    pnlHeader.Children.Remove(headerButton);
            //}
            headerButton           = (GnosisToggleButton)_headerButton;
            headerButton.GotFocus += headerButton_GotFocus;
            //Binding binding = new Binding("IsSelected");
            //binding.Source = this;
            //headerButton.SetBinding(GnosisToggleButton.IsCheckedProperty, binding);
            // headerButton.Margin = new Thickness(0);
            //headerButton.Padding = new Thickness(5);
            //headerButton.BorderThickness = new Thickness(0);
            this.Header = headerButton;
            // btnClose.Visibility = Visibility.Visible;
            //  btnClose.CopyStyle(headerButton.Style);
            //string xaml = XamlWriter.Save(btnClose.Style);

            if (frameImplementation is GnosisSearchFrame)
            {
                gridContent.Children.Add((GnosisSearchFrame)frameImplementation);
            }
            else
            {
                gridContent.Children.Add((GnosisFrame)frameImplementation);
            }

            HideLoadingAnimation();
        }
 public void SetHeaderButton(IGnosisToggleButtonImplementation _headerButton)
 {
     //if (headerButton != null && pnlHeader.Children.Contains(headerButton))
     //{
     //    pnlHeader.Children.Remove(headerButton);
     //}
     headerButton           = (GnosisToggleButton)_headerButton;
     headerButton.GotFocus += headerButton_GotFocus;
     //Binding binding = new Binding("IsSelected");
     //binding.Source = this;
     //binding.Mode = BindingMode.TwoWay;
     //headerButton.SetBinding(GnosisToggleButton.IsCheckedProperty, binding);
     // headerButton.Padding = new Thickness(5);
     //headerButton.BorderThickness = new Thickness(0);
     //headerButton.Margin = new Thickness(0);
     //pnlHeader.Children.Add(headerButton);
     this.Header = headerButton;
     //Canvas.SetZIndex(headerButton, 99);
     ////headerButton.IsHitTestVisible = true;
     ////headerButton.Background = Brushes.Blue;
     //btnClose.Style = headerButton.Style;
     //borderHeader.Visibility = Visibility.Visible;
     //string xaml = XamlWriter.Save(headerButton.Style);
     //DockPanel.SetDock(headerButton, Dock.Left);
     //pnlHeader.Children.Add(headerButton);
 }
        public static void ControlThicknessPropertyChanged(object source, DependencyPropertyChangedEventArgs e)
        {
            GnosisToggleButton toggleButton = source as GnosisToggleButton;
            int    newThickness             = (int)e.NewValue;
            int    oldThickness             = (int)e.OldValue;
            double marginHorizontal;
            double marginVertical;

            if (newThickness > oldThickness)
            {
                //increase border thickness, decrease margin
                marginHorizontal = toggleButton.HorizontalMargin - newThickness;
                marginVertical   = toggleButton.VerticalMargin - newThickness;

                if (marginHorizontal >= 0 && marginVertical >= 0)
                {
                    toggleButton.Margin          = new Thickness(marginHorizontal, marginVertical, marginHorizontal, marginVertical);
                    toggleButton.BorderThickness = new Thickness(newThickness);
                    //toggleButton.Height = toggleButton.Height + (newThickness - oldThickness);

                    double fieldHeight = GlobalData.Singleton.StyleHelper.GetFieldHeight(toggleButton, toggleButton.FontFamily.ToString(),
                                                                                         (int)toggleButton.FontSize);
                    toggleButton.SetHeight(fieldHeight);
                }
            }
            else
            {
                //decrease border thickness, increase margin
                marginHorizontal = toggleButton.HorizontalMargin + oldThickness;
                marginVertical   = toggleButton.VerticalMargin + oldThickness;

                if (marginHorizontal >= 0 && marginVertical >= 0)
                {
                    toggleButton.Margin          = new Thickness(marginHorizontal, marginVertical, marginHorizontal, marginVertical);
                    toggleButton.BorderThickness = new Thickness(newThickness);

                    double fieldHeight = GlobalData.Singleton.StyleHelper.GetFieldHeight(toggleButton, toggleButton.FontFamily.ToString(),
                                                                                         (int)toggleButton.FontSize);
                    toggleButton.SetHeight(fieldHeight);
                }
            }
        }
Example #4
0
 public void AddToggleButton(GnosisToggleButton toggleButton)
 {
     mnu.Items.Add(toggleButton);
 }
Example #5
0
 public void AddToggleButton(GnosisToggleButton toggleButton)
 {
     //this.Items.Add((GnosisToggleButton)toggleButton);
     this.Children.Add((GnosisToggleButton)toggleButton);
 }