Пример #1
0
        protected void TurnOnBorders()
        {
            object borderElement = FindName("borderAll");

            if (borderElement != null)
            {
                Border border = borderElement as Border;
                border.Style = this.Resources["mainGadgetBorder"] as Style;
            }

            object headerPanelElement = FindName("headerPanel");

            if (headerPanelElement != null)
            {
                Controls.GadgetHeaderPanel header = headerPanelElement as Controls.GadgetHeaderPanel;
                header.Visibility = System.Windows.Visibility.Visible;
            }

            object shadowRectangleElement = FindName("rectangleShadow");

            if (shadowRectangleElement != null)
            {
                ShadowRectangle rectangle = shadowRectangleElement as ShadowRectangle;
                rectangle.Visibility = System.Windows.Visibility.Visible;
            }

            object infoPanel = FindName("infoPanel");

            if (infoPanel != null)
            {
                GadgetInfoPanel panel = infoPanel as GadgetInfoPanel;
                if (!string.IsNullOrEmpty(panel.Text))
                {
                    panel.Visibility = System.Windows.Visibility.Visible;
                }
            }
        }
Пример #2
0
        protected void TurnOffBorders()
        {
            object borderElement = FindName("borderAll");

            if (borderElement != null)
            {
                Border border = borderElement as Border;
                border.Style = null;
            }

            object headerPanelElement = FindName("headerPanel");

            if (headerPanelElement != null)
            {
                Controls.GadgetHeaderPanel header = headerPanelElement as Controls.GadgetHeaderPanel;
                header.Visibility = System.Windows.Visibility.Hidden;
            }

            object shadowRectangleElement = FindName("rectangleShadow");

            if (shadowRectangleElement != null)
            {
                ShadowRectangle rectangle = shadowRectangleElement as ShadowRectangle;
                rectangle.Visibility = System.Windows.Visibility.Hidden;
            }

            object infoPanel = FindName("infoPanel");

            if (infoPanel != null)
            {
                GadgetInfoPanel panel = infoPanel as GadgetInfoPanel;
                if (panel.Visibility == System.Windows.Visibility.Visible)
                {
                    panel.Visibility = System.Windows.Visibility.Hidden;
                }
            }
        }
Пример #3
0
        protected virtual void SetCustomFilterDisplay()
        {
            object el = this.FindName("txtFilterString");

            if (el != null && el is TextBlock)
            {
                TextBlock txtFilter = el as TextBlock;
                if (this.DataFilters != null && this.DataFilters.Count > 0)
                {
                    txtFilter.MaxWidth   = this.ActualWidth;
                    txtFilter.Text       = string.Format(DashboardSharedStrings.GADGET_CUSTOM_FILTER, this.DataFilters.GenerateReadableDataFilterString());
                    txtFilter.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    txtFilter.Text       = string.Empty;
                    txtFilter.Visibility = System.Windows.Visibility.Collapsed;
                }
            }

            el = this.FindName("infoPanel");
            if (el != null && el is GadgetInfoPanel)
            {
                GadgetInfoPanel panel = el as GadgetInfoPanel;
                if (this.DataFilters != null && this.DataFilters.Count > 0)
                {
                    panel.MaxWidth   = this.ActualWidth;
                    panel.Text       = string.Format(DashboardSharedStrings.GADGET_CUSTOM_FILTER, this.DataFilters.GenerateReadableDataFilterString());
                    panel.Visibility = System.Windows.Visibility.Visible;
                }
                else
                {
                    panel.Text       = string.Empty;
                    panel.Visibility = System.Windows.Visibility.Collapsed;
                }
            }
        }