Example #1
0
        /// <summary>
        /// Construct content within propertyName dashboard gadget. It is assumed that view consists of propertyName
        /// constructor that takes viewmodel instance and view model class consists od propertyName cons-
        /// tructor that takes IEventAggregator, IDBInteractivity and ILoggerFacade instance.
        /// </summary>
        /// <param name="gadgetViewClassName">Gadget view Type</param>
        /// <param name="gadgetViewModelClassName">Gadget View Model Type</param>
        /// <returns></returns>
        private object GetDashboardTileContent(string displayName, string gadgetViewClassName, string gadgetViewModelClassName, object viewModelObject = null)
        {
            object content = null;

            try
            {
                Assembly assembly      = TypeResolution.GetAssembly(gadgetViewClassName);
                Type     viewType      = TypeResolution.GetAssemblyType(gadgetViewClassName);
                Type     viewModelType = viewModelObject == null?TypeResolution.GetAssemblyType(gadgetViewModelClassName) : viewModelObject.GetType();

                if (viewType.IsClass && viewModelType.IsClass)
                {
                    Type[]   argumentTypes  = new Type[] { typeof(DashboardGadgetParam) };
                    object[] argumentValues = new object[] { GetDashboardGadgetParam(displayName) };
                    if (viewModelObject == null)
                    {
                        viewModelObject = TypeResolution.GetNewTypeObject(viewModelType, argumentTypes, argumentValues);
                    }
                    content = TypeResolution.GetNewTypeObject(viewType, new Type[] { viewModelType }, new object[] { viewModelObject });
                    ViewBaseUserControl control = (ViewBaseUserControl)(content);
                    if (control != null)
                    {
                        control.IsActive = true;
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Log("User : "******"\nMessage: " + ex.Message + "\nStackTrace: " + ex.StackTrace, Category.Exception, Priority.Medium);
                Prompt.ShowDialog("Message: " + ex.Message + "\nStackTrace: " + ex.StackTrace, "Exception", MessageBoxButton.OK);
            }

            return(content);
        }
Example #2
0
        /// <summary>
        /// Executed on navigation to this view
        /// </summary>
        /// <param name="navigationContext">NavigationContext</param>
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            ViewBaseUserControl control = (ViewBaseUserControl)cctrDashboardContent.Content;

            if (control != null)
            {
                control.IsActive = true;
            }
        }
 private void SetIsActiveOnDahsboardItems(bool value)
 {
     foreach (RadTileViewItem item in this.rtvDashboard.Items)
     {
         ViewBaseUserControl control = (ViewBaseUserControl)item.Content;
         if (control != null)
             control.IsActive = value;
     }
 }
        /// <summary>
        /// Set IsActive property on Dashboard content
        /// </summary>
        /// <param name="value">IsActive value</param>
        private void SetIsActiveOnDahsboardItems(bool value)
        {
            ViewBaseUserControl control = (ViewBaseUserControl)cctrDashboardContent.Content;

            if (control != null)
            {
                control.IsActive = true;
            }
        }
Example #5
0
        public void OnNavigatedFrom(NavigationContext navigationContext)
        {
            ViewBaseUserControl control = (ViewBaseUserControl)cctrDashboardContent.Content;

            if (control != null)
            {
                control.IsActive = false;
            }
            RefreshScreen.refreshFlag = false;
        }
        public void OnNavigatedFrom(NavigationContext navigationContext)
        {
            // navigationContext.NavigationService.Region.Context = _viewModel.NavigationInfo;
            ViewBaseUserControl control = (ViewBaseUserControl)cctrDashboardContent.Content;

            if (control != null)
            {
                control.IsActive = false;
            }
        }
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            //   _viewModel.ManageMeetingsServiceCalls();
            ViewBaseUserControl control = (ViewBaseUserControl)cctrDashboardContent.Content;

            if (control != null)
            {
                control.IsActive = true;
            }
        }
Example #8
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     foreach (RadTileViewItem item in this.rtvDashboard.Items)
     {
         ViewBaseUserControl control = (ViewBaseUserControl)(item.Content);
         if (control != null)
         {
             control.IsActive = true;
         }
     }
 }
Example #9
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            if (RefreshScreen.refreshFlag)
            {
                this.cctrDashboardContent.Content = new ViewCustomScreeningTool(new ViewModelCustomScreeningTool(tempParam));
            }
            ViewBaseUserControl control = (ViewBaseUserControl)cctrDashboardContent.Content;

            if (control != null)
            {
                control.IsActive = true;
            }
        }
Example #10
0
        /// <summary>
        /// Handle Dashboard Gadget Add event
        /// </summary>
        /// <param name="param">DashboardTileViewItemInfo</param>
        public void HandleDashboardTileViewItemAdded(DashboardTileViewItemInfo param)
        {
            try
            {
                foreach (RadTileViewItem rtvitem in this.rtvDashboard.Items)
                {
                    if ((rtvitem.Header as Telerik.Windows.Controls.HeaderedContentControl).Content as string == param.DashboardTileHeader &&
                        rtvitem.Content.GetType().Name == param.DashboardTileObject.GetType().Name)
                    {
                        return;
                    }
                }
                RadTileViewItem item = new RadTileViewItem();
                item.RestoredHeight = 300;
                item.Header         = new Telerik.Windows.Controls.HeaderedContentControl
                {
                    Content    = param.DashboardTileHeader,
                    Foreground = new SolidColorBrush(Colors.Black),
                    FontSize   = 8,
                    FontFamily = new FontFamily("Arial")
                };
                item.Content = param.DashboardTileObject;
                this.rtvDashboard.Items.Add(item);

                ViewBaseUserControl control = (ViewBaseUserControl)(item.Content);
                if (control != null)
                {
                    control.IsActive = true;
                }

                if (this.rtvDashboard.Items.Count == 1)
                {
                    this.rtvDashboard.RowHeight = new GridLength(400);
                    (this.rtvDashboard.Items[0] as RadTileViewItem).TileState = TileViewItemState.Maximized;
                }
                if (this.rtvDashboard.Items.Count == 2)
                {
                    (this.rtvDashboard.Items[0] as RadTileViewItem).TileState = TileViewItemState.Restored;
                    (this.rtvDashboard.Items[1] as RadTileViewItem).TileState = TileViewItemState.Restored;
                }
            }
            catch (InvalidOperationException)
            {
                //System generates data errors that could be ignored
            }
        }
 public void HandleDashboardTileViewItemAdded(DashboardTileViewItemInfo param)
 {
     try
     {
         foreach (RadTileViewItem rtvitem in this.rtvDashboard.Items)
         {
             if (rtvitem.Header as string == param.DashboardTileHeader)
             {
                 ViewBaseUserControl control = (ViewBaseUserControl)(rtvitem.Content);
                 if (control != null)
                 {
                     control.IsActive = true;
                 }
             }
         }
     }
     catch (InvalidOperationException)
     {
         //System generates data errors that could be ignored
     }
 }
Example #12
0
        /// <summary>
        /// Generate DCF Report PDF
        /// </summary>
        /// <param name="sender">Sender of Event</param>
        /// <param name="e"></param>
        private void btnPDF_Click(object sender, RoutedEventArgs e)
        {
            DCFReport = new List <Table>();
            RadDocument mergedDocument = new RadDocument();

            RadDocument finalReport = new RadDocument();

            foreach (RadTileViewItem item in this.rtvDashboard.Items)
            {
                ViewBaseUserControl control = (ViewBaseUserControl)item.Content;
                DCFPDFExport        pdfData = control.CreateDocument();
                Table table = null;
                if (pdfData != null)
                {
                    table = pdfData.DataTable;
                    if (pdfData.CreatedBy != null && pdfData.SecurityName != null && pdfData.CountryName != null)
                    {
                        SecurityName = pdfData.SecurityName;
                        CountryName  = pdfData.CountryName;
                        CreatedBy    = pdfData.CreatedBy;
                        CreationDate = DateTime.Now.ToShortDateString();
                    }
                }
                if (table != null)
                {
                    DCFReport.Add(table);
                }
            }
            if (DCFReport != null)
            {
                finalReport = MergeDocuments(DCFReport);
                finalReport.SectionDefaultPageMargin = new Telerik.Windows.Documents.Layout.Padding()
                {
                    All = 10
                };
                PDFExporter.ExportPDF_RadDocument(finalReport, 10);
            }
        }