/// <summary>
        /// Called when the render has a link we need to listen to.
        /// </summary>
        public void RegisterNewHyperLink(HyperlinkButton newImagelink, string linkUrl, bool isHyperLink)
        {
            newImagelink.Click += NewImagelink_Click;

            newImagelink.SetValue(HyperlinkUrlProperty, linkUrl);

            newImagelink.SetValue(IsHyperlinkProperty, isHyperLink);

            _listeningHyperlinks.Add(newImagelink);
        }
コード例 #2
0
        /// <summary>
        /// Called when the render has a link we need to listen to.
        /// </summary>
        public void RegisterNewHyperLink(HyperlinkButton newHyperlink, string linkUrl)
        {
            // Setup a listener for clicks.
            newHyperlink.Click += NewHyperlinkButton_Click;

            // Associate the URL with the hyperlink.
            newHyperlink.SetValue(HyperlinkUrlProperty, linkUrl);

            // Add it to our list
            _listeningHyperlinks.Add(newHyperlink);
        }
コード例 #3
0
        /// <summary>
        /// Inserts Content in the specific treeview node (category) specific to document type data
        /// </summary>
        /// <param name="data">DocumentCategoricalData</param>
        /// <returns>RadTreeViewItem to be inserted in the category node</returns>
        private RadTreeViewItem InsertTreeViewItem_Document(DocumentCategoricalData data)
        {
            RadTreeViewItem documentTreeViewItem = new RadTreeViewItem()
            {
                HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch
            };

            RadExpander headerExpander = new RadExpander()
            {
                ExpandDirection            = Telerik.Windows.Controls.ExpandDirection.Down,
                HorizontalAlignment        = System.Windows.HorizontalAlignment.Stretch,
                HorizontalHeaderAlignment  = System.Windows.HorizontalAlignment.Stretch,
                HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch,
                FlowDirection = System.Windows.FlowDirection.RightToLeft
            };

            #region Expander Header
            Grid headerExpanderHeaderGrid = new Grid()
            {
                FlowDirection = System.Windows.FlowDirection.LeftToRight
            };

            headerExpanderHeaderGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1, GridUnitType.Star)
            });
            headerExpanderHeaderGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(200)
            });
            headerExpanderHeaderGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(50)
            });
            headerExpanderHeaderGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(150)
            });

            #region Document Name Grid
            Grid headerExpanderHeaderGridDocumentNameGrid = new Grid()
            {
                Margin = new Thickness(-8, 0, 0, 0)
            };
            headerExpanderHeaderGridDocumentNameGrid.SetValue(Grid.ColumnProperty, 0);
            headerExpanderHeaderGridDocumentNameGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            headerExpanderHeaderGridDocumentNameGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1, GridUnitType.Star)
            });

            HyperlinkButton fileNameHyperlink = new HyperlinkButton()
            {
                Content           = data.DocumentCatalogData.FileName,
                NavigateUri       = new Uri(data.DocumentCatalogData.FilePath, UriKind.RelativeOrAbsolute),
                VerticalAlignment = System.Windows.VerticalAlignment.Center,
                Foreground        = new SolidColorBrush(Colors.Black),
                Style             = (Style)(this.Resources["HyperlinkButtonStyle"])
            };

            fileNameHyperlink.SetValue(Grid.ColumnProperty, 0);

            TextBlock fileNameUpdateNotification = new TextBlock()
            {
                Text              = "*NEW*",
                Margin            = new Thickness(2, 0, 0, 0),
                Foreground        = new SolidColorBrush(Colors.Red),
                VerticalAlignment = System.Windows.VerticalAlignment.Center,
                TextWrapping      = TextWrapping.Wrap,
                Visibility        = Visibility.Collapsed,
                Style             = (Style)(this.Resources["TextBlockStyle"])
            };

            updateInfo.Add(new UpdationData()
            {
                UpdationTag     = UpdationTags.DOCUMENT_NAME,
                UpdationInfo    = data,
                UpdationElement = fileNameUpdateNotification
            });

            fileNameUpdateNotification.SetValue(Grid.ColumnProperty, 1);

            headerExpanderHeaderGridDocumentNameGrid.Children.Add(fileNameHyperlink);
            headerExpanderHeaderGridDocumentNameGrid.Children.Add(fileNameUpdateNotification);
            #endregion

            #region Document Company Name
            TextBlock headerExpanderHeaderGridDocumentCompanyName = new TextBlock()
            {
                Text              = data.DocumentCompanyName,// + " (" + data.DocumentSecurityTicker + ")",
                Margin            = new Thickness(5, 0, 0, 0),
                VerticalAlignment = System.Windows.VerticalAlignment.Center,
                TextWrapping      = TextWrapping.Wrap,
                Style             = (Style)(this.Resources["TextBlockStyle"])
            };
            headerExpanderHeaderGridDocumentCompanyName.SetValue(Grid.ColumnProperty, 1);
            #endregion

            #region Document Uploaded By
            TextBlock headerExpanderHeaderGridDocumentUploadedBy = new TextBlock()
            {
                Text              = data.DocumentCatalogData.FileUploadedBy,
                Margin            = new Thickness(5, 0, 0, 0),
                VerticalAlignment = System.Windows.VerticalAlignment.Center,
                TextWrapping      = TextWrapping.Wrap,
                Style             = (Style)(this.Resources["TextBlockStyle"])
            };
            headerExpanderHeaderGridDocumentUploadedBy.SetValue(Grid.ColumnProperty, 2);
            #endregion

            #region Document Uploaded On
            TextBlock headerExpanderHeaderGridDocumentUploadedOn = new TextBlock()
            {
                Text              = data.DocumentCatalogData.FileUploadedOn.ToLocalTime().ToString("MMMM dd, yyyy"),
                Margin            = new Thickness(5, 0, 0, 0),
                VerticalAlignment = System.Windows.VerticalAlignment.Center,
                TextWrapping      = TextWrapping.Wrap,
                Style             = (Style)(this.Resources["TextBlockStyle"])
            };
            headerExpanderHeaderGridDocumentUploadedOn.SetValue(Grid.ColumnProperty, 3);
            #endregion

            headerExpanderHeaderGrid.Children.Add(headerExpanderHeaderGridDocumentNameGrid);
            headerExpanderHeaderGrid.Children.Add(headerExpanderHeaderGridDocumentCompanyName);
            headerExpanderHeaderGrid.Children.Add(headerExpanderHeaderGridDocumentUploadedBy);
            headerExpanderHeaderGrid.Children.Add(headerExpanderHeaderGridDocumentUploadedOn);

            headerExpander.Header = headerExpanderHeaderGrid;
            #endregion

            #region Expander Content
            Border headerExpanderContentBorder = new Border()
            {
                BorderThickness = new Thickness(0, 1, 0, 1), BorderBrush = new SolidColorBrush(Colors.Black)
            };
            Grid headerExpanderContentGrid = new Grid()
            {
                FlowDirection = System.Windows.FlowDirection.LeftToRight
            };
            headerExpanderContentGrid.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });
            headerExpanderContentGrid.RowDefinitions.Add(new RowDefinition()
            {
                Height = GridLength.Auto
            });

            #region Comment Listing
            Grid headerExpanderContentGridCommentGrid = new Grid()
            {
                Margin = new Thickness(0, 5, 0, 0)
            };
            headerExpanderContentGridCommentGrid.SetValue(Grid.ColumnProperty, 0);
            headerExpanderContentGridCommentGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            headerExpanderContentGridCommentGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            headerExpanderContentGridCommentGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1, GridUnitType.Star)
            });

            foreach (CommentDetails comment in data.CommentDetails.OrderByDescending(record => record.CommentOn))
            {
                InsertComment_Documents(comment, headerExpanderContentGridCommentGrid);
            }

            headerExpanderContentGrid.Children.Add(headerExpanderContentGridCommentGrid);
            #endregion

            #region Content Updation
            Grid headerExpanderContentGridUpdationGrid = new Grid();
            headerExpanderContentGridUpdationGrid.SetValue(Grid.RowProperty, 1);
            headerExpanderContentGridUpdationGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1, GridUnitType.Star)
            });
            //headerExpanderContentGridUpdationGrid.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            headerExpanderContentGridUpdationGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });
            headerExpanderContentGridUpdationGrid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = GridLength.Auto
            });

            #region Comment Box
            TextBox documentCommentUpdation = new TextBox()
            {
                Margin    = new Thickness(5),
                MaxLength = 255,
                Style     = (Style)(this.Resources["TextBoxStyle"])
            };
            documentCommentUpdation.SetValue(Grid.ColumnProperty, 0);
            #endregion

            #region Alert Label
            TextBlock alertLabel = new TextBlock()
            {
                Text              = "Alert:",
                Margin            = new Thickness(5, 0, 0, 0),
                VerticalAlignment = System.Windows.VerticalAlignment.Center,
                FontWeight        = FontWeights.Bold,
                Style             = (Style)(this.Resources["TextBlockStyle"])
            };
            alertLabel.SetValue(Grid.ColumnProperty, 1);
            #endregion

            #region Alert User Listing
            RadSplitButton userListingDropDownButton = new RadSplitButton()
            {
                Content        = "Alert",
                DropDownHeight = 200,
                Height         = (Double)(this.Resources["DefaultControlMinHeight"]),
                Style          = (Style)(this.Resources["RadSplitButtonStyle"])
            };

            RadListBox listBox = new RadListBox()
            {
                SelectionMode     = Telerik.Windows.Controls.SelectionMode.Multiple,
                ItemsSource       = DataContextViewModelDocuments.UserInfo,
                DisplayMemberPath = "UserName",
                Style             = (Style)(this.Resources["RadListBoxStyle"])
            };

            userListingDropDownButton.DropDownContent = listBox;
            userListingDropDownButton.SetValue(Grid.ColumnProperty, 1);

            //RadComboBox userListingComboBox = new RadComboBox()
            //{
            //    Margin = new Thickness(5, 0, 0, 0),
            //    Height = (Double)(this.Resources["DefaultControlMinHeight"]),
            //    Style = (Style)(this.Resources["RadComboBoxStyle"])
            //};
            //userListingComboBox.SetValue(Grid.ColumnProperty, 2);
            #endregion

            CommentUpdationData commentUpdationTagInfo = new CommentUpdationData()
            {
                CommentAlertInput    = userListingDropDownButton,
                CommentUpdationInput = documentCommentUpdation,
                CommentInsertionGrid = headerExpanderContentGridCommentGrid,
                CommentUpdationInfo  = data
            };

            RadButton commentUpdationButton = new RadButton()
            {
                Margin  = new Thickness(5, 0, 5, 0),
                Content = "+",
                HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center,
                Tag    = commentUpdationTagInfo,
                Height = (Double)(this.Resources["DefaultControlMinHeight"]),
                Style  = (Style)(this.Resources["RadButtonStyle"])
            };

            commentUpdationButton.SetValue(Grid.ColumnProperty, 2);
            commentUpdationButton.Click += new RoutedEventHandler(DocumentCommentUpdation);

            headerExpanderContentGridUpdationGrid.Children.Add(documentCommentUpdation);
            //headerExpanderContentGridUpdationGrid.Children.Add(alertLabel);
            //headerExpanderContentGridUpdationGrid.Children.Add(userListingComboBox);
            headerExpanderContentGridUpdationGrid.Children.Add(userListingDropDownButton);
            headerExpanderContentGridUpdationGrid.Children.Add(commentUpdationButton);
            #endregion

            headerExpanderContentGrid.Children.Add(headerExpanderContentGridUpdationGrid);
            headerExpanderContentBorder.Child = headerExpanderContentGrid;

            headerExpander.Content = headerExpanderContentBorder;
            #endregion

            documentTreeViewItem.Header = headerExpander;

            return(documentTreeViewItem);
        }