Silverlight - Highlight List<> of words/prhases within TextBox - silverlight

I am new to Silverlight and have a requirement to highlight (or change font color) all words and phrases wtihin a TextBox that match a list of words/phrases. At first I though this would be easy, but the more I look into it, the more confused I get.
My goal is to write something reusable so I can also apply the logic to a RadGridView later. I've seen a few examples of stuff close to what I need, but it's beyond my Silverlight level at this point.
I want to write this myself to get a better understanding of how some of the Silverlight internals work. Can someone point me in the right direction of where to start on something like this? Should this be implemented in a control? Should I use a behavior? I'm using Silverlight 4.
Once I know where to start, I am sure I can get this done - with some help from you guys of course ;-)
Thanks,
-Scott

How about using the RadRichTextBox (I assume you have a licence for it as you mentionned the RadGridView)?
There's also a good sample project on Telerik forum that is doing exactly what you want to do.

Related

Drawing app - the easiest design

Well, I'm a newbie. I'd like to write an app in WPF. The main purpouse will be in drawing predefined elements/objects. Input from user is mostly realized by text boxes - numbers. But I'd like to add some kind of user input into drawing itself too + zooming and moving. Next functionality will be in saving the draw for later loading and another editing (printing maybe, but it's far far away).
I can imagine something like this:
due to some user interaction I'd prefere to use of InkCanvas
i want to define my own elements/objects with some properties. But where it will be define? Some external file maybe?
the save file will be composed of XAML code only
I will study this more lately, but I want to know if my thoughts are in the right way.
Are these points correct, or completely bullshit? :)
Thanks, and sorry for English...
I don't know if this is exactly what are you looking for, but here a little list of advice to help you on reaching your goal:
First of all, if you are crating an application, you should see this before. It explain the Model-View-ViewModel pattern, which is essential when you are creating something on WPF. This can help you abount your 2nd point.
Regarding your save file, i don't know exactly what you have in mind, but it depends on what do you want to save exactly. If you want, InkCanvas have the option to export directly the work in a bitmap . If you need to store some setting, depending on your need you can work with Settings or Resources
InkCanvas seems the appropriate tool for your need. Of course you will have to build your app around this control

Listbox or Listview or Gridview?

I am trying to achieve this.
I have a list of records (filenames) which I want to show in a list.
Anybody has any idea as to which control to use.
Regards,
Deepak
The information is right at your fingertips. You should learn to use Snoop. Aside from that, you should choose whatever control works best for you, which requires you to learn the difference between each. We can't really provide a good answer because there are many different ways this control could be implemented, and that's why WPF is so powerful.
Basically, you'll want to use a mixture of a Grid and ItemsControl. You can see the layout of the controls that are being used in this screenshot:

WPF chart control: OxyPlot documentation

I'm looking for a simple, free charting control for WPF. After some reading (e.g. WPF chart controls), I had a look at OxyPlot: http://oxyplot.codeplex.com/
It looks very promising and well done: did you ever use it? Can you suggest a place to find some additional reference (that on the website seems to be still incomplete)?
I started to use this library as well. Until now I like it.
About the documentation, I agree it is indeed quite poor. Probably the best you can do is to explore the code of the examples that you find in the project. I can say I could find all the code I need.
By the way the only small problem that I have had until now is visible in picture. It happens with a large number of points (e.g.. > 1000).
EDIT:
this problem happens when LineJoin is set to OxyPenLineJoin.Miter;
it can be solved by
LineJoin = OxyPenLineJoin.Bevel;
or
LineJoin = OxyPenLineJoin.Round;
Hope this helps

Styling WPF slider background

I'm trying to apply a specific style to a slider control and I'm having trouble figuring out what I need to do for the slider's background. What do I need to do to get something like this triangle to show in the background of my slider?
I initially thought I would define a GeometryDrawing and set something in the tickbar tag to it - but I can't find anything suitable.
This is what I'm looking for. Thanks for any ideas.
Slider background http://img16.imageshack.us/img16/690/slider.png
Check out my Intuipic project, which does something similar (only horizontally):
you need to investigate a bit more into styling and templatiting in wpf. I would expect the easiest way would be to define a Control Template but you 'might' be able to achieve this with just styling
Check out this page on msdn for starters. There is probably loads of other resources out there. Big sections on it in the book i'm reading at the moment - pro wpf in c# 2008
Sorry i'm not coming up with an example... you'd be better off doing a bit of background reading and then coming back with any specific issues.

How to Format Numbers in WinForms 1.1 DataGrid?

Is there a simple way to format numbers in a Winforms 1.1 datagrid? The Format property of the DataGridTextBoxColumn seems to be completely ignored. I know there is a solution that involves subclassing a Column control, and it's fairly simple, but was hoping there might be some trick to making the Format property just work.
My personal opinion is that a datagridcolumnstyle is the way to go. Without seeing the code that you have, I can't say for certain why your formatting isn't taking hold when no style is defined - but mixing in formatting with data calculations and other parts of the code can get very messy very quickly.
Creating a new column style class is very clean, and if you have to use the same formatting again in another datagrid, it's as easy as pie to reuse it.
Here's the Microsoft Documentation that may get you started in the right direction.
I did subclass and it was easy and did work. I still don't like it so much. I was already subclassing column styles for other reasons. I'd rather handle all databinding myself, where I can more easily change it and test it. This whole mixing of the UI with the data is old school, and not in a good way.
Thanks very much for your answers, it's good to have second opinions.
Mike

Resources