WPF text editor with multiple (fixed) sub-sections - wpf

I am trying to find a solution for the following scenario: users should be able to manually edit multi-line text in a control. However, the text should be split into multiple "sub-sections" as maintained by the software. User should still be able to select/copy&paste text fragments across sections, but should not be able to delete sections as illustrated below:
The ability to do this with rich-text formatting (at least bold/italics,...) would be nice, but is not mandatory.
I have been trying to figure out a way to accomplish this in WPF.
Just stacking separate textboxes does not allow users to select across sections.
Does anyone know if a control that does that (open source or commercial) or some strategy to do this as a custom control?
Any help is appreciated.

Related

How to find name of my XAML file in my WPF application at run time

I am working on very complex WPF application which has many resource files because of which XAML doesn't load at design time. I want to find names of XAML files, at run time. I am trying to use snoop but not able to find name of XAML file. Please help
Using Snoop won't give you file names but you should be able to locate some type names (i.e. UserControls, custom controls, etc) or elements with x:Names by looking through the visual tree view near where you're trying to get to after using the Ctrl-Shift mouse-over shortcut. Searching for either usages of types (in the case of controls) or using Find in Files on all solution *.xaml files should help you find the elements you're looking for.
Usually I do this by starting at a high level of the UI (for example MainWindow)
and the draw the components on paper that I find there, especially the grids.
Then I try to figure out where the elements of my application are in that view.
If you have multiple views, this can be somewhat timeconsuming. But if you
cannot just click through the designer windows, this is one of the fastest
possible ways to do it.
Okay, if you only have minor changes, you can try to find the element that
you want to change by using string search.
Find the label you want, if it is a resource string, find the usage of it.
If you have a complex MVVM application, you can start by investigating
the ViewModels used. They can be a better starting point than the View
itself.
-edit-
WPF Inspector can give you good hints on where to search.
You can get it here: WPF Inspector home
If you are looking for it for your own needs, you can call BaseUriHelper.GetBaseUri(v) on any visual and it will give you the Uri of the resource that your visual comes from. From this Uri you can get the origin xaml file

What control can be used to display txt files as well as pfd and .doc

I'm relatively new to windows forms programming and was looking for a control that could be used to display both .txt, pdf, and doc files. When I first started googling for a solution I was led to the possibility of using the wpf xps control, but I would have to figure out how to integrate that within a win form app and still wasn't clear as to whether it would solve all my problems. Any guidance on this will be greatly appreciated.
Thank you!
In general, I wouldn't do that (try to find a single control that can do everything). Instead I'd think about creating different controls for different types of content and toggling the visible state on the control depending on what content you're displaying.

UI control with grouping

I'm looking in silverlight for a control that support grouping and the possibility to customize the group header with a template (like a grid with text and images)
I tried the DataGrid, but I can set only a String as the group header (or if I'm wrong how can I display a string and two images?)
Thank you
Francesco
BTW: I'm using MVVM and bindings.
EDIT: I'm looking primarily to something standard (microsoft) or free component. Or we (the company for which I work) already use ComponentOne.
You didn't specify free or not but if you are looking for off the shelf products Telerik offers a number of Silverlight controls. Their RadGrid allows for custom datatemplating as well as your other requirements of grouping and image usage.
Another good one that I have used on testing but never in production is jibGrid on Codeplex. You may want to check that one out as well jibgird on CodePlex It does support grouping but I can't recall usage of images in the header.
If you are looking for using the default datagrid you can customize the header and column headers using datatemplates See this msdn link for more information As far as grouping, sorting and filtering this is not offered out of the box as with the aforementioned controls. To do this you will need to write a little code own your own. This msdn article provides some steps on how to accomplish this.
Hope this helps
I decided to use the FlexGrid of ComponentOne.
In this way I used the grouping mode to group (together with the disclosure function), and the merging function to merge the first column of each group.

What kind of WPF composition would I need to implement a two way node diagram?

I shall create a visual component to display and navigate a large network of nodes. Nodes have input terminals and output terminals. The total network is too large to be displayed on a single screen.
I see that GUI component vendors have visio-like flowchart/diagramming components for free form placement. It's not exactly what I am looking for. The output should look flowchart-ish, but the functionality is more of a bunch of listboxes / stackpanel / treeview control. I suppose I could make this into a grid or something so that everything should reposition itself dynamically as the user navigates and expand sections, but it is unclear to me how I would then make the connection lines "follow" the item that it is connected to. The nodes are of various types, so there should absolutely be some kind of visual template selection (like datatemplate).
I assume that the topic of visualizing interconnected nodes is a general problem. I've also learned that WPF layout panels are powerful if you apply them correctly, so I am hoping somebody who are more versed in their functionality will be able to break it down into a sensible composition of controls.
BTW I have the Telerik UI RadControls for WPF.
Do you have any tips or solution for how this functionality can be achieved by composing WPF (and/or Telerik) controls?

gridview control capable of displaying rich text in WinForms

I'm looking for a WinForms control that would allow me to display data in a table like manner but with some rich content such as different font colors, images. I do not need data-binding etc., just a "table of RichTextBox controls". I suppose it wouldn't be difficult to build such a control myself, but I thought I'd ask first...
Thanks for your answers.
You always have the option of creating your own DataGridView column type. I've done this a few times recently and found that it works quite well. It takes surprisingly little code and knowledge of GDI to put together something very nice.
What information are you trying to display in your grid?

Resources