Beispiel #1
0
        /// <summary>
        /// Helps to create a control for a tile.
        /// </summary>
        /// <param name="controlType"></param>
        /// <param name="tile"></param>
        /// <returns></returns>
        private FrameworkElement CreateControl(Tile tile)
        {
            var controlType = tile.ControlType;

            switch (controlType)
            {
            case "Chart":
                OlapChart olapChart = new OlapChart()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, GetConnectionString())
                };
                olapChart.Loaded += new RoutedEventHandler(olapChart_Loaded);
                return(olapChart);

            case "Grid":
                return(new OlapGrid()
                {
                    Style = (Style)FindResource("olapGridStyle"),
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, GetConnectionString())
                });

            case "Gauge":
                OlapGauge olapGauge = new OlapGauge()
                {
                    OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, GetConnectionString())
                };
                SkinStorage.SetVisualStyle(olapGauge, "Office2007Blue");
                return(olapGauge);
            }

            return(null);
        }
Beispiel #2
0
        private void DefaultReport()
        {
            Tile tile = new Tile();

            tile.Header = "OlapChart";
            this.DashboardReport.Tiles.Add(tile);
            tile.Report      = this.DashboardReport.Reports.ElementAt(1);
            tile.ControlType = "Chart";
            OlapChart olapChart = new OlapChart()
            {
                OlapDataManager = OlapDataSourceHelper.GetManager(tile.Report.ReportFileName, GetConnectionString())
            };

            olapChart.Loaded += new RoutedEventHandler(olapChart_Loaded);
            this.tileViewControl.Items.Add(new TileViewItem
            {
                Header            = tile.Header,
                Tag               = olapChart,
                TileViewItemState = tile.TileState,
                Content           = olapChart
            });
        }
Beispiel #3
0
        private void Bind()
        {
            this.SelectedControl.Report = this.SelectedReport;

            var control = (from TileViewItem t in this.tileViewControl.Items
                           where t.Header == this.SelectedControl.Header
                           select t).FirstOrDefault();

            if (control != null)
            {
                if (this.SelectedControl.ControlType == "Chart")
                {
                    (control.Content as OlapChart).OlapDataManager = OlapDataSourceHelper.GetManager(this.SelectedControl.Report.ReportFileName, GetConnectionString());
                }
                else if (this.SelectedControl.ControlType == "Grid")
                {
                    (control.Content as OlapGrid).OlapDataManager = OlapDataSourceHelper.GetManager(this.SelectedControl.Report.ReportFileName, GetConnectionString());
                }
                else if (this.SelectedControl.ControlType == "Gauge")
                {
                    (control.Content as OlapGauge).OlapDataManager = OlapDataSourceHelper.GetManager(this.SelectedControl.Report.ReportFileName, GetConnectionString());
                }
            }
        }