Increasing the size of a WPF application - wpf

I've just created my first WPF application (3 calculators inside 3 different tabs).
The entire application has been built using widths/margins/paddings as static values, since I originally didn't know that dynamic values can be used by just putting an asterix after the value.
The client has come back to me though and has asked me to increase the size of the app, that includes form fields, tabs, font-sizes, grids etc...
What would be the easiest (and/or quickest) way to do this? I'd hate to go value by value resizing every single element since there are quite a few.
I can provide code but there is lots of it and I'm not sure of how much help it would be.
Appreciate your help,
Marko

Put it all in one ViewBox, play with viewbox size to change the app size

Write an XSLT transform to take your XAML as input and spit out appropriate modified XAML, which you put back in your app.

Related

I want bigger pixbufs rendered onto GtkSourceGutter

It seems that the size of the source marks rendered with GtkSourceGutterRenderer are remotely tied up to the size of the text in the GtkSourceView. I want to have bigger pixbufs, without making the text font size bigger and to achieve that I concluded I have to subclass a widget and override its draw signal handler.
However I have no idea which widget to subclass on. Surely one of you knows?
I think it's probably GtkSourceGutterRendererPixbuf itself that you have to subclass. If not that, then probably GtkSourceGutterRenderer with a lot of duplicated code from GtkSourceGutterRendererPixbuf.

Intersected, buffered polygon - ArcGIS API for Silverlight

I am using Silverlight (4) to create an application in (VS 2010). I utilized the ArcGIS API’s for Silverlight to generate the following scenario:
I buffered a polyline to a variable distance.
I then retrieve all but only those polygons that are overlapped by the buffer.
I then intersect the overlapped portions to separate them.
Attaining the separated overlapped portions, I was about to utilize the Area and perimeter service to retrieve the areas of the portions, but realized that this last step would be in the wind.
I have no problem coding the above scenario except; I now realize that step 4 would not be very useful at this point, since I have no way of sharing data between the separated overlapped portions to the original polygons. Imagine if you will; before I separated the overlapped portions from the polygons, they had data tied to them; such as valuationNumber and volume, but after the separation due to the intersection service, the separated portions seems blank with no data. My goal is to have a list highlighting the valuationNumber, volume, and the area of the separated portion.
Something like:
Valuation:
12345678
Volume:
1234/123
Area of Separation (M):
12
Any, and I mean any help would be appreciated.
[copied and pasted my comments from above due to laziness]
Well then, I would suppose I created a work around, I wonder if there is a right way out there though. Anyhow, I did the following: I created a Dictionary Object and populated it with the Attribute values of the original polygon just as they are created. Then, just as the overlapped portions are being created I assigned the attribute values from my Dictionary. So, now the values match up, and all binding works just fine. But hey, if anyone know a better way; I'm all eyes.
In fact, to make matters seem a bit better, I made an improvement on the work around. I create a class with the fields I wanted to be in both original and separated portions. Then added this class as the value parameter of my dictionary object I spoke of earlier, then followed the same procedure. Now I have all the fields being mapped to in XAML working nicely (for now).

WPF tabswitch/ render takes too much time

I have a WPF application with many tabs..
in one tab.. i make a verycomplex vector drawing consisting of thousands of drawing visuals.. (this represents a machine and all elements need to be interactable..)
It takes 3/4 seconds for drawing this for the first time..After the first draw it should be done..
The problem is if i switch to another tab and comeback, it takes atlease 2,3 seconds to show the tabpage with drawing again.. Since there is no redraw, why should it take so much time..?
If the component is not going to change, you could call Freeze() on it to mark it as done. Without trying it out I don't know if that would help, but you could give it a shot.
Not all objects are Freezable. Check out the MSDN documentation for more info:
http://msdn.microsoft.com/en-us/library/ms750509.aspx
Another thing you could try would be rendering the vector art to a bitmap, and displaying that. Maybe it makes you feel icky to lose the vector precision, but if you know it's not going to change and it will look the same, what's the harm? (If you support printing or something that will require a hi-res version, you could always switch back for that operation.) For info on how to convert a UIElement to a bitmap, check out:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspx
Another possible solution: You don't really explain what kind of interaction you are doing with the elements, but if all you want to do is zoom and pan, a RenderTransform may be good enough (which is more efficient than a LayoutTransform and/or moving all the elements individually). I haven't played around with combining Freeze() and a RenderTransform, but you may be able to get the desired zooming while reducing the amount of layout WPF has to do.

How to convince WPF (Blend) designer to user panels and layouts?

In Blend, as soon as you insert a control (like Button) and start dragging it onto Window/Grid/whatever you get hard-coded margins and width/height.
Thus designer that I work with ends up creating beautiful static pictures that, on my side, fall apart as soon as one data-bound string is longer than the sample ones. Or if font size gets increased. Text ends up clipped or otherwise unreadable.
Blends makes it so easy to make rigid, but pretty designs, that I have a hard time selling the need for a more complex design work, using styles and panels, to my designer. By now I see only one option - let design eventually fail at customer's site and have designer learn the lesson from that failure. Of course, it is not a great solution to use customer's bad experience just to educate designer.
What are your experiences and suggestions in this area?
If it would make sense, clip long strings with '...'
Otherwise, change the sample data to be the same length as maximum allowed values.
You can even use multiple sample data sources: one for minimum lengths, one for average lengths, and one for maximum lengths. Ask the designer to check the layout using each one.

Printing text from silverlight application

I'm trying to print a report (just text in columns) from my Silverlight 4 application. The only way I know about is to use PrintDocument and set the PageVisual to a framework element showing the report. However, this results in an insanely large print job (like 120 MB). This is not what my customer wants. Is there any other solution?
The problem with Silverlight 4 is that everything you go to print is produced as a rasterized image at 600 DPI. This explains the large job size you are seeing. This is also why text from Silverlight can look very fuzzy compared to what you'd expect from your output. Silverlight 5 will address this with Postscript vector-based printing, but for now you are facing the reality that without third-party solutions you are effectively stuck with the out of the box limitations or using HTML.
If you are willing to generate the report from HTML being served server-side you may have the best solution considering what you're doing. In that case you would at least not have to worry about complexities like pagination as part of printing from Silverlight.
A good third-party solution for reporting, but perhaps more than what you need, is to use Reporting Services coupled with this product: http://www.perpetuumsoft.com/Silverlight-Viewer-for-Reporting-Services.aspx?lang=en
One easy solution is to print web page directly from browser (I assume this is not what you want).
I think the PrintDocument and PageVisual is the only way how to print from inside of SL.
I did some printing even with large visual structures, but I haven't checked how large my print job is, so I can't tell you if it is normal or not.
Anyway, you can try not to print directly the element you want to print, but made some other lightweight one which will serve only for printing purposes and fill it with same data and print that lightweight element.
You can convert your text into picture and then print picture.. mb this will help you
http://www.andybeaulieu.com/Home/tabid/67/EntryID/161/Default.aspx
http://www.snowball.be/Printing+In+Silverlight+3+Yes+We+Can.aspx

Resources